solrsolrnetrelevancesolr-boost

Getting Solr Elevated Results on top of Sorted by field Results


We are using Solr 5. We are able to apply sorting on display order field in to Solr query and it works fine. We have certain results which are elevated and will always want them first. If we remove the sorting, the elevation works fine. However, we are unable to get both of them work together.

We want to first list elevated results in the top and then other results based on the display order field.

However, we are unable to find how to do this. Any help will be appreciated.

Thanks in advance.


Solution

  • QueryElevation respects the sort parameter by default, but you can override this by giving the forceElevation parameter:

    forceElevation

    By default, this component respects the requested sort parameter: if the request asks to sort by date, it will order the results by date. If forceElevation=true (the default), results will first return the boosted docs, then order by date.