AI OnAI Off
The problem is that the property PublishDate doesn't exist in the index. You ned to change your search to search for SitePageData instead, something like this:
var typeSearch = searchClient.Search<SitePageDatal>() .For(model.Query) .OrderBy(x => x.StartPublish) .GetContentResult();
And then do the mapping to SearchViewModel or do a projection directly in the Find query by using the Select extension method.
Hi,
I have a problem with sorting my search results. Below you have two types of searching:
Using Unified search:
Using Search:
In unified search everything works fine. My results are sorted by SearchPublishDate as expected. The problem is in the second query. It returns the same results as the first one but the order is different. It seems to be ordered by score instead of PublishDate. Any sugestions what am I doing wrong?