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

Da Huang commented on LUCENE-4396:
----------------------------------

{quote}True, but maybe in such cases (low freqs for the clauses) we should just 
use BS2. I think BS/BNS do better for high-freq clauses?{quote}
I'm sorry that I could not be sure whether it's ture now, as I haven't made a 
closer analysis on the perf results. 
The perf of BS/BNS depends on many factors, such as freq of each clause and the 
number of SHOULD(and MUST_NOT) clauses.

{quote}I think we may get better performance when the MUST clauses are high 
freq, if we just use BooleanScorer to enumerate all the matching docs for each 
MUST instead of going through ConjunctionScorer?{quote}
I afraid that enumerating all the matching docs would not get better perf. 
In fact, BS2 and ConjunctionScorer collect docs by the method called 
"document-at-a-time"(DAAT), 
while BS/BNS is something like a combination of DAAT and 
"term-at-a-time"(TAAT). 
For conjunctive clauses, it's more efficient to use DAAT than TAAT, as DAAT 
scans fewer docs than TAAT.

> BooleanScorer should sometimes be used for MUST clauses
> -------------------------------------------------------
>
>                 Key: LUCENE-4396
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4396
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>         Attachments: And.tasks, AndOr.tasks, AndOr.tasks, LUCENE-4396.patch, 
> LUCENE-4396.patch, LUCENE-4396.patch, LUCENE-4396.patch, LUCENE-4396.patch, 
> LUCENE-4396.patch, luceneutil-score-equal.patch, luceneutil-score-equal.patch
>
>
> Today we only use BooleanScorer if the query consists of SHOULD and MUST_NOT.
> If there is one or more MUST clauses we always use BooleanScorer2.
> But I suspect that unless the MUST clauses have very low hit count compared 
> to the other clauses, that BooleanScorer would perform better than 
> BooleanScorer2.  BooleanScorer still has some vestiges from when it used to 
> handle MUST so it shouldn't be hard to bring back this capability ... I think 
> the challenging part might be the heuristics on when to use which (likely we 
> would have to use firstDocID as proxy for total hit count).
> Likely we should also have BooleanScorer sometimes use .advance() on the subs 
> in this case, eg if suddenly the MUST clause skips 1000000 docs then you want 
> to .advance() all the SHOULD clauses.
> I won't have near term time to work on this so feel free to take it if you 
> are inspired!



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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

Reply via email to