0
votes

I am running Solr 4.10.3 and trying to resort top 10 documents come from Solr. How can i do that? I am thinking of sub-query but don't know how to do that, needed help.

Example: Suppose on query of "car" Solr return 250 documents on the basis of high score of relevancy. Now from 250 documents take top 10 documents and resort them on the basis of custom field.

i can't do that:

select?q=car&sort=score desc, pr desc

Because it will do sorting on entire 250 documents. So is there any solution?

1

1 Answers

0
votes

I think you mean query reranking ? This is what is used when you want to:

  1. use a first, more lightweight query to get a result based on the score
  2. get a fair top x number of matches, like 2000 for example
  3. use a heavier query to resort only those again, to get the final score

That is what you need to use if you want to do it in two steps, like you state. Now, I am not sure you need to use query reranking for your use case, maybe just boosting by that field, or sorting on a function should be enough for you.