Try our conversational search powered by Generative AI!

EPiServer Search Sorting

Vote:
 

I'm using trying to create a full text search over pages and files simultaneously using the examples found on http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-CMS/7/Search/Search-Integration/

Generally it's working as I want but I can't find any examples on how to sort the results in any order other than rank (such as title or published date)

Is this possible?


Thanks

#75959
Oct 14, 2013 5:35
Vote:
 

Should be able to attach a filterevent handler to the searchdatasource.filter event. Im not sure if this only filters pages though.

Or you could get the content from the searchdatasource: searchDataSource.Select(new DataSourceSelectArguments()); and then do your custom filtering and bind to a repeater for presentation.

 

#75968
Oct 14, 2013 12:06
Vote:
 

Hi Per,

Thanks for your response. I'm using EPiServer 7 MVC and razor and I need the full text searching, filtering and sorting to be done on the server and exposed via web API so I don't think I can use the SearchDataSource web control as it's intended.

#75982
Oct 14, 2013 22:14
Vote:
 

Hi,

I would also like to know this! From what I can see there is not parameter for that in the service call (/search/?q={q}&namedindexes={namedindexes}&offset={offset}&limit={limit}&format=xml&accesskey={accesskey}).

But maybe it's possible to add the sorting in the query with a custom IQueryExpression!?

#77461
Nov 20, 2013 1:45
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.