[ 
https://issues.apache.org/jira/browse/LUCENE-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17053517#comment-17053517
 ] 

David Smiley commented on LUCENE-8103:
--------------------------------------

Notice that {{TwoPhaseIterator.asDocIdSetIterator(tpi);}} will return an 
implementation whose {{advance(docId)}} method will move beyond the passed in 
docID and call matches until it finds a match.  That is a waste _if the user of 
this DISI doesn't care what the next matching document is if the approximation 
doesn't match_.  So QueryValueSource's exists() method could work with the 
approximation first and if that matches, then and only then call TPI.match.  If 
there is no TPI then the the scorer's DISI is accurate.

> QueryValueSource should use TwoPhaseIterator
> --------------------------------------------
>
>                 Key: LUCENE-8103
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8103
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/other
>            Reporter: David Smiley
>            Priority: Minor
>         Attachments: LUCENE-8103.patch
>
>
> QueryValueSource (in "queries" module) is a ValueSource representation of a 
> Query; the score is the value.  It ought to try to use a TwoPhaseIterator 
> from the query if it can be offered. This will prevent possibly expensive 
> advancing beyond documents that we aren't interested in.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to