I’d do multiple queries in parallel. It is super easy with Solr. Send each query request, then go back and read each response. They happen in parallel without any threads in the client.
If you want the total, then do another query. It will share cached posting lists with the other queries, so they’ll all be fast together. wunder Walter Underwood [email protected] http://observer.wunderwood.org/ (my blog) > On Aug 2, 2017, at 3:11 PM, Michael McCandless <[email protected]> > wrote: > > Do you really need to know which term/s caused a given hit for every single > hit, or only for the top N hits? > > If you must know this for every single hit, you should make your own > Collector and use the Scorer.getChildren API to gather the sub-scorer for > each term, and on collecting each hit, look at those children to see which > ones matched the current hit. > > If it's only for the top N hits, it's more efficient to do a 2nd step with > those hits where you test each term separately to see if they match it. > > Mike McCandless > > http://blog.mikemccandless.com <http://blog.mikemccandless.com/> > On Wed, Aug 2, 2017 at 1:48 AM, Sarthak Sugandhi <[email protected] > <mailto:[email protected]>> wrote: > Hi Fellow Luceneers, > > I am trying to search multiple terms in an index at one go and I want to > differentiate search results for each term all in the same query. > > Could you suggest what is the class/method name. > > Thanks, > Sarthak >
