frosty
frosty

Reputation: 2852

Solr: ranking of results when querying multiple shards

If I'm querying across two shards and first shard returned 10 rows and second one returned 100 rows, how is the combined result set ranked? Will I end up with results from first shard (the one with least result) appearing first?

Upvotes: 1

Views: 297

Answers (1)

YoungHobbit
YoungHobbit

Reputation: 13402

When each of the shard returns result for a given query, the results are sorted by the similarity score for each document. The similarity score is a relative measure of how well the document matches to the search query.

Now these results from different shards are merged by the similarity score and presented to the user/application. The similarity scores are calculated within shards before the merge of results happen.

You can include parameters &shard.info=true and fl=*,score into the query and see the result. Then observe what is the maxScore returned by each shard and look at each document with score. You will get the insight how the result are merged.

Upvotes: 1

Related Questions