var xq = _serachCriteria.Field(fieldName,fieldValue).And().OrderByDescending(new SortableField(orderByField,SortType.String)).Compile();
_searchResults = _searchEngine.Search(xq);
It returns all the results it should based on fieldName and Value but if I add SortBy or SortByDecending I get the following example results for the product code which is the same as not adding SortBy...
WGS416CD, WGS422CD, WGS353CD
This is the order of the product pages as they are listed under the "products" page in Umbraco.
I'm sure I'm doing something stupid but can't see what, any help totally appreciated.
it's kind of counter intuitive as you are just changing the sort order of what's there, but you need to rebuild them from the examine developer dashboard to have this kind of change picked up.
If you have rebuilt, or rebuilding doesn't fix it then I'm wondering if
var xq = _serachCriteria.Field(fieldName,fieldValue).And().OrderByDescending("albumCode").Compile();
works, eg having set the EnableSorting to be true, (and rebuilt indexes) then I think you should just be able to pass the name of the field via string... although your SortableField implementation looks fine (as long as orderByField = "albumCode" !!!)
Examine working not sorting
Hi,
Version 7.10.3
I'm Trying out Examine the performance is amazing, but when I apply an OrderBy the results are not sorted.
I've added to examineIndex config...
The code for doing the search is
It returns all the results it should based on fieldName and Value but if I add SortBy or SortByDecending I get the following example results for the product code which is the same as not adding SortBy...
WGS416CD, WGS422CD, WGS353CD
This is the order of the product pages as they are listed under the "products" page in Umbraco.
I'm sure I'm doing something stupid but can't see what, any help totally appreciated.
Cheers Rich
Hi Rich
Have you rebuilt your index after adding the EnableSort setting??
it's kind of counter intuitive as you are just changing the sort order of what's there, but you need to rebuild them from the examine developer dashboard to have this kind of change picked up.
If you have rebuilt, or rebuilding doesn't fix it then I'm wondering if
works, eg having set the EnableSorting to be true, (and rebuilt indexes) then I think you should just be able to pass the name of the field via string... although your SortableField implementation looks fine (as long as orderByField = "albumCode" !!!)
regards
Marc
All working now Marc, I rebooted the server. But I had rebuilt the index before as enable sorting was "true" under user fields.
Anyway thanks.
is working on a reply...