Sounds like you'll want use the ScoreCachingWrappingScorer. Your DelegatingCollector can wrap the ScoreCachingWrappingScorer around the scorer passed into the setScorer(Scorer) method and pass it to down the collector chain.
Joel Bernstein Search Engineer at Heliosearch On Fri, Nov 14, 2014 at 3:29 PM, Andy Crossen <acros...@gmail.com> wrote: > Hi folks, > > I have a DelegatingCollector installed via a PostFilter (kind of like an > AnalyticsQuery) that needs the document score to a) add to a collection of > score-based stats, and b) decide whether to keep the document based on the > score. > > If I keep the document, I call super.collect() (where super is a > TopScoreDocCollector), which re-scores the document in its collect method. > The scoring is custom and reasonably expensive. > > Is there an easy way to avoid this? Or do I have to stop calling > super.collect(), manage my own bitset/PQ, and pass the filtered results in > the DelegatingCollector's finish() method? > > There's a thread out there ("Configurable collectors for custom ranking") > that kind of talks about the above. Seems cumbersome. > > Thanks for any direction! >