How to get results in sorted order when I use face

2019-08-06 14:37发布

问题:

Usually a solr query with facetting option returns the results in sorted order based on the facet count. When I set the facet limit to -1 the results were not returned in sorted order; this means I have to do the sorting manually in the server side.

Should I need to append anything more in the solr query to get it in a sorted order?

回答1:

please try facet.sort=count

The default facet order is base on the count, descending order, but it will return the index order rather than count desc order if facet.limit is less than 0

Details can be read from Solr Wiki