Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Liferay 7.2 Adding relevance sorting in custom query
Hi All,
I am using liferay 7.2 sp1 tomcat and made a custom module in order to fetch content for that I have written a boolean query to fetch content based on parameters , how can I sort these result set on the basis of relevance.
Please suggest.
I am using liferay 7.2 sp1 tomcat and made a custom module in order to fetch content for that I have written a boolean query to fetch content based on parameters , how can I sort these result set on the basis of relevance.
Please suggest.
Hi ,
You can set sorting in searchcontext, please refer below url
https://www.programcreek.com/java-api-examples/?class=com.liferay.portal.kernel.search.SearchContext&method=setSorts
You can set sorting in searchcontext, please refer below url
https://www.programcreek.com/java-api-examples/?class=com.liferay.portal.kernel.search.SearchContext&method=setSorts