IndexSearcher will call LeafCollector.setScorer(Scorer) for you when you call IndexSearcher.search(Query, Collector). All you need to do is to keep a reference to this Scorer object and use it in the LeafCollector.collect(int) method.
Le jeu. 1 sept. 2016 à 14:42, szzoli <reg9sz...@freemail.hu> a écrit : > I created a collector with > SimpleCollector collector = new TotalHitCountCollector(); > but when I wanted to call > collector.setScorer(scorer); > the scorer has again several parameters: > Scorer scorer = new ConstantScoreScorer(Weight, float, disi); > Do I have to create these objects, too? > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Lucene-6-1-number-of-hits-per-document-tp4293245p4294286.html > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >