Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
The query is run in the Search and Navigation service, it does not have access to your code but only what has been indexed. So you either need to fetch all items and do the sorting locally. This is a bad option. Or you need to index this value as well, and update it when the likes increase. This is the better option.
To display a list of pages, we built up a query and following is a part of it.
Strangely, it does not sort the results in descending order of the likecount.
However, for another filteration, it does work. The difference here is LikeCount probably returns values on the fly. Meaning it's defined as follows in the blog page.
public virtual int LikeCount { get { return LikedUsers?.Count ?? 0; } }
and finally the result retrieved
var result = blogsQuery.Take(MaximumResultsPerRequest).Skip((pageNum - 1) * MaximumResultsPerRequest).GetContentResult();
Is this a limitation of Search and Navigation ? Is there a workaround ?