lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark harwood <markharw...@yahoo.co.uk>
Subject ConjunctionScorer.doNext() overstays?
Date Thu, 01 Mar 2012 09:39:59 GMT
Due to the odd behaviour of a custom Scorer of mine I discovered ConjunctionScorer.doNext()
could loop indefinitely.
It does not bail out as soon as any scorer.advance() call it makes reports back "NO_MORE_DOCS".
Is there not a performance optimisation to be gained in exiting as soon as this happens?
At this stage I cannot see any point in continuing to advance other scorers - a quick look
at TermScorer suggests that any questionable calls made by ConjunctionScorer to advance to
NO_MORE_DOCS receives no special treatment and disk will be hit as a consequence.
I added an extra condition to the while loop on the 3.5 source:

    while ((doc != NO_MORE_DOCS)  && ((firstScorer = scorers[first]).docID() <
doc)) {
    
and Junit tests passed.I haven't been able to benchmark performance improvements but it looks
like it would be sensible to make the change anyway.

Cheers,
Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message