lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Query Match Count
Date Sun, 08 Aug 2010 14:17:11 GMT
Do you need this for a single document, eg for debugging?  If so,
IndexSearcher.explain can give you these details.

If you need it for all hits, then Lucene does not make that easy
today, which is somewhat frustrating because this information (freq of
occurrence of each clause matching the current hit) is being computed,
to compute the net score; it's just not accessible.

But this is requested fairly often, so... I just opened an issue to
make this possible:


On Sun, Aug 8, 2010 at 12:44 AM, Ryan McV <> wrote:
> Hello All,
> Is there a way to count the number of times a query matched in a particular
> document?
> For example, say we created a document that had the string "cheese cheese
> cheese cheese" in the field that is being searched.
> I would like to know that the query "cheese" matched four times in that
> particular document. Is there a way to do this?
> BTW, I am new to Lucene, so if I have any misconceptions that are apparent
> please feel free to correct me.
> Thanks,
> Ryan

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message