Erick Thanks for your response and for the pointers! This will be a good starting point; I will go through these.
The good news is in our usecase, we don't really care about the two passes. In fact, our results are ConstantScore so we only need to aggregrate (i/e sum) the results from each shard. Regards Chetan On Wed, Jul 15, 2015 at 12:14 PM, Erick Erickson <erickerick...@gmail.com> wrote: > bq: Is there a way to invoke IndexSearcher.search(Query, Collector) > > Problem is that this question doesn't make a lot of sense to me. > IndexSearcher is, by definition, local to a single Lucene > instance. Distributed requests are a whole different beast. If you're going > to try to use custom request handlers in a distributed environment > (SolrCloud), you need to abstract up a level, see: > Here are some places to start: > > > https://cwiki.apache.org/confluence/display/solr/Distributed+Search+with+Index+Sharding > http://wiki.apache.org/solr/WritingDistributedSearchComponents > > The thing to be aware of is that the "usual" way of writing this > involves two passes. Say you want to return the top 10 docs and have 5 > shards. > The first pass sends the request to one replica of each shard. Each returns > its top 10 docs, but only the doc ID and score (or sort criteria). Then the > aggregator (whichever node received the original requests) sorts those 50 > docs > into the true top N and sends a second request to each of the shards > hosting one > of those docs for the contents of the doc. > > Now, you can probably bypass a lot of that if you're happy with > returning the topN > lists from all the shards, this two-pass mechanism was put in place to > handle, say, > a 100 shard system where you wouldn't want to transmit all the top N from > every > shard. > > HTH, > Erick > > > On Wed, Jul 15, 2015 at 8:46 AM, Chetan Vora <chetanv...@gmail.com> wrote: > > Hi all > > > > I asked a related question before but couldn't get any response (see > > SolrQueryRequest in SolrCloud vs Standalone Solr), asking it differently > > here. > > > > Is there a way to invoke > > > > IndexSearcher.search(Query, Collector) over a SolrCloud collection so > that > > in invokes the search/collect implicitly on individual shards of the > > collection? If not, how does one do this explicitly? > > > > I have a usecase that was implemented using custom request handler in > > standalone Solr and we're trying to move to SolrCloud. It is necessary > for > > us to understand how to do the above so we can use SolrCloud > functionality. > > > > Thanks and would *really really* appreciate ANY help. > > > > Regards > > CV >