lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrien Grand <jpou...@gmail.com>
Subject Re: Lucene 6.1: number of hits per document
Date Mon, 29 Aug 2016 12:06:32 GMT
Le lun. 29 août 2016 à 12:00, <reg9szabo@freemail.hu> a écrit :

> I was searching for a word in an index (multiple files were indexed in a
> library). I was searching e.g for "run". A document contained two times, an
> other three times this word.
> I would like to see int the result for the firs document "2", for the
> other "3".
>

If the Query is a TermQuery, you can get this number by calling
Scorer.freq() on the Scorer that is passed to Collector.setScorer(). Is it
what you were looking for?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message