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

Adrien Grand commented on LUCENE-6244:
--------------------------------------

bq. Can you explain this comment a bit more, I'm not sure I understand:

The first patch worked like conjunctions, the scorer first advanced the 
approximation and then called nextDoc() on the approximation until it found a 
document that matches. So when scores were not needed, you could just stop 
calling "matches()" as soon as one of the clauses that are positionned on the 
current doc matches. I don't think it's an important optimization but was worth 
mentioning.

The new patch is different. In the priority queue, we store both a reference to 
the sub scorer and its approximation. And the disjunction scorer moves to the 
next doc by moving the **scorer** in the pq, while the approximation moves to 
the next candidate by moving the **approximation** in the pq.

bq. Why do we pass needsScores to these disjunctions? It seems to only optimize 
the case where someone doesnt needScores but calls freq() anyway.

I didn't want to optimize anything in particular, but having the freq computed 
eagerly made the two-phase view a bit easier to implement. I can try to make it 
lazy again.

> Approximations on disjunctions
> ------------------------------
>
>                 Key: LUCENE-6244
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6244
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>             Fix For: Trunk, 5.1
>
>         Attachments: LUCENE-6244.patch, LUCENE-6244.patch, wikibig.tasks
>
>
> Like we just did on exact phrases and conjunctions, we should also support 
> approximations on disjunctions in order to apply "matches()" lazily.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to