November Happy Hour will be moved to Thursday December 5th.

Son Do
Jul 26, 2018
  9313
(3 votes)

Sorting issue in Episerver Find 13.0.1

We have known an issue about sorting in Find 13.0.1 that we can reproduce

  • Create a developer index in find.episerver.com.
  • Create some properties for string, DateTime, int type for a page type
  • Create some page using those page types.
  • Run the site and index the content.
  • In the test page, create query and sort by Date or SortNumber.
var query = _searchClient.Search<BasePage>()
    .FilterForVisitor()
    .OrderBy(x => x.MyOwnDate)
    .Select(x => new SearchItem
    {
        PageTitle = x.Name,
MyOwnDate = x.MyOwnDate, SortNumber = x.SortNumber, TeaserText = x.TeaserText, ID = x.ContentLink.ID }) .Take(100); model.SearchResults = query.GetResult().Hits.Select(x => x.Document).ToList();

And the bug is published https://world.episerver.com/support/Bug-list/bug/FIND-3596 and will be fixed in next version.

While waiting for upgrading to the next version, we can have a way of working around:

.OrderBy(x => x.MyOwnDate, null, null, false);
// Or
.OrderBy(x => x.MyOwnDate, null, SortOrder.Ascending, false);
// For order descending, we had:
.OrderBy(x => x.MyOwnDate, null, SortOrder.Descending, false);

We need to change OrderBy clause and make sure that the ignoreUnmapped parameter is false.

We can apply the same working around for other types: date, int, ...

Hope this helps your work.

/Son Do

Jul 26, 2018

Comments

Kane Made It
Kane Made It Jul 26, 2018 10:55 AM

Great, thanks! I received several questions from partner yesterday. Not sure if we have official location to create a bug or request from user. She created a thread on World only.

Son Do
Son Do Jul 26, 2018 03:28 PM

Hi Khanh, World forum is a place that we can discuss and post bug. Currently, we don't have another channel for developers do that.

ngoanmai
ngoanmai Aug 31, 2018 07:48 AM

Thank @Khanh for helping with this question!

Hi @SonDo, I tried following your instruction but it still does not work.

I have the ArticlePage with [ArticleDate] which is my custom field. Trying to make the very simple search query with the sorting(tried both Assending and Dessending) but the result was not sorted. 

Please see the attached image for more detail(https://ibb.co/ePKHL9).

The field definition:

public virtual DateTime ArticleDate { get; set; }

And the search query with the sorting:

var articles1 = _searchClient.Search(Language.English)
.CurrentlyPublished()
.PublishedInCurrentLanguage()
.Filter(searchFilter)
.ExcludeDeleted()
.OrderBy(a => a.ArticleDate, null, SortOrder.Ascending, false)
.Take(pageSize)
.StaticallyCacheFor(TimeSpan.FromMinutes(5))
.GetContentResult();

var dates = articles1.Select(x => x.ArticleDate);

Do you have any suggestion for it?

Thanks so much :).

Son Do
Son Do Sep 25, 2018 04:34 AM

Hi Ngoan, 

Sorry for the late comment. I tried your search query in my Alloy site and it worked properly.

I'm not sure what happens to your site or your search query. Have you got more information that I can trace the issue?

/Son Do

Son Do
Son Do Sep 25, 2018 04:38 AM

Hi Ngoan, 

Sorry for the late comment. I tried your search query in my Alloy site and it worked properly.

I'm not sure what happens to your site or your search query. Have you got more information that I can trace the issue?

/Son Do

Sheider
Sheider Oct 5, 2018 03:35 AM

Hey thanks for this! One thing I noticed after upgrading to 13.0.3 I was still seeing this issue. However it was bizzare because I would not see this behavior on my local solution with a find development index but this issue came to light on the development environment with the clients purchased development find license. I have since added this fix and all works as it should now, but it may be worth investigating on 13.0.3 as well.

Christian Simpson
Christian Simpson Oct 23, 2018 11:22 PM

Hi,

I am seeing the exact same behavior that Sean mentioned. On all 13.0.x versions of Find (including 13.0.3 where the issue was supposedly fixed), I only see this sorting bug on indices which are provisioned as part of a customer's DxC license (https://es-us-api01.episerver.com). I do not see this behavior with indices created on find.episerver.com (https://es-eu-dev-api01.episerver.net).

That being said, this workaround seems to work on all 13.0.x versions of Find for indices which are provided by DxC. Thank you for the valuable info!

Thorbjørn Nielsen
Thorbjørn Nielsen Dec 3, 2018 01:40 PM

Hi

We still having the same problem with Find 13.0.5.0 after getting a new find index on https://es-eu-api03.episerver.net

I dont get the same behovior on https://es-eu-dev-api01.episerver.net locally.

I hade to use the same workaround to make it work.

Torbjörn Hansson
Torbjörn Hansson Dec 20, 2018 12:36 PM

I have the same issue when sorting on nested objects with Find 13.0.5 on DXC environment. Working on demo index. The result seem to be sorted but in different fragments.

Dave Johnson
Dave Johnson Jan 18, 2019 02:35 PM

Hi @SonDo

We are having the same sorting issue with production indexes located on https://es-eu-api03.episerver.net.

Using a dev index on https://es-eu-dev-api01.episerver.net with the same content and Nuget package version (13.0.1) seems to work absolutely fine.

Is this a an index-side code issue rather than related to the client-side library?

The bug report linked to from this post doesn't have a fix version associated with it, so has it been fixed or not? - https://world.episerver.com/support/Bug-list/bug/FIND-3596

Dave

Please login to comment.
Latest blogs
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog