lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szzoli <>
Subject Re: Lucene 6.1: number of hits per document
Date Thu, 01 Sep 2016 12:20:43 GMT

"If the Query is a TermQuery, you can get this number by calling 
Scorer.freq() on the Scorer that is passed to Collector.setScorer()."

My problem is that I do not know how can one get Scorer.freq(). Scorer is an
abstect class. It has many deived classes. I don't know wich one to use. The
derived classes are sometimes also abstract. The non-abstract classes have
constuctors with some other class parameters (Weight float score,
DocIdSetIterator for ConstantScoreScorer, e.g.) Some of them are also
abstract. Now again I have to look for some subclasses. 

They also might be abstract, or have constuctors with several class
parameters, ans so on...

How can I get to Scorer.freq() so that the Scorer sould know, which
Documentt's hits I am seaching for? Can you show me an example?

Thank you.

View this message in context:
Sent from the Lucene - Java Users mailing list archive at

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

View raw message