lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Searching multiple terms and mapping each term with their search result.
Date Wed, 02 Aug 2017 22:11:20 GMT
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

On Wed, Aug 2, 2017 at 1:48 AM, Sarthak Sugandhi <sarthaksugandhi9@gmail.com
> 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
>

Mime
View raw message