[ https://issues.apache.org/jira/browse/LUCENE-3364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080439#comment-13080439 ]
John Wang commented on LUCENE-3364: ----------------------------------- Hi Yonik: In Collector, the decision time to cut of a score would be too late, e.g. float score = Scorer.score(); <--- this is where the cost would occur. boolean cutOff = decide(score) In my example, my score impl: float s1 = cheapCalc(docid); float s2 = expensiveCalc(docid); return s1+s2; So now if I know expensiveCalc is bounded by N, and cheapCalc returns a very small number, I can simply skip s2 calculation because this doc would be thrown out anyway. Hope I am making sense :) -John > Add score threshold into Scorer.score() > --------------------------------------- > > Key: LUCENE-3364 > URL: https://issues.apache.org/jira/browse/LUCENE-3364 > Project: Lucene - Java > Issue Type: Improvement > Components: core/query/scoring > Reporter: John Wang > > This is an optimization for scoring. > Given a Scorer.score() implementation, where features are gathered to > calculate a score. > Proposal, add a parameter to score, e.g. score(float threshold) > This threshold is the minimum score to "beat" to make it to the current > PriorityQueue. This could potential save a great deal of wasted calculation > in the cases where recall is large. > In our case specifically, some of the features needed to do calculation can > be expensive to obtain, it would be nice to have a place to decide whether or > not even fetching these features are necessary. > Also, if we know the score would be low, simply threshold can be returned. > Let me know if this makes sense and I can work on a patch. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org