0

In Solr , I am fetching results using groupBy on "hash" ( my custom field ) field. As we know each group will contains a set of documents.

My requirement is:

  1. Solr first do a sorting based on score , that it is already doing.
  2. If score of any two groups is same , then group with more number of documents should come up.
  3. If even number of documents are same , then there should be some tie-breaker.

I need guidance for point 2 and 3. I am not able to get how to do it using 'sort' parameter.

Thanks Amit Aggarwal

voila
  • 1,594
  • 2
  • 19
  • 38

1 Answers1

0

2)group with more number of documents should come up

There is no way to do it. Alternatively, you can use two queries to achieve this. Facets. They are, by default, sorted by numfound. And they loop through facet results to get results per facet.

akshayb
  • 1,219
  • 2
  • 18
  • 44