Sorting issue in Episerver Find 13.0.1 | Episerver Developer Community
Views: 1130
Number of votes: 2
Average rating:

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
  • 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>()
    .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 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

    (By KaneMadeIt , 26 July 2018 10:55, Permanent link)

    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.

    (By Son Do , 26 July 2018 15:28, Permanent link)

    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.

  Please login to post a comment