Web / Apache Solr Interview questions
How does Solr handle distributed search across shards?
When a collection has multiple shards, a query sent to any single replica must still search all shards to produce a complete result, since each shard only holds part of the data. Solr coordinates this transparently using a scatter-gather approach.
The replica that received the request acts as a coordinator. It first asks every shard for just doc IDs and sort/score values, merges and sorts that combined list, then makes a second round of requests to fetch the full stored fields only for the final page of results, avoiding the cost of transferring full documents from shards whose results won't even be returned.
More Related questions...