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

Uwe Schindler edited comment on LUCENE-7416 at 8/25/16 4:56 PM:
----------------------------------------------------------------

bq. The part that rewrites boolean queries into a MatchNoDocsQuery if some 
clauses are bothe excluded and required is indeed broken on 6.x because of 
queryNorm. 

That was my second guess :-) But I agree with your question that checking the 
query norm for a query that does not match anything is not needed (even on 
6.x), because something that does not match anything does not produce any score 
that could have wrongly normalized :-)
 Although it is a should clause in a top-level BQ, then it affects norm (I 
think that's the issue, right?)
I will commit the simplification patch on master later on.


was (Author: thetaphi):
bq. The part that rewrites boolean queries into a MatchNoDocsQuery if some 
clauses are bothe excluded and required is indeed broken on 6.x because of 
queryNorm. 

That was my second guess :-) But I agree with your question that checking the 
query norm for a query that does not match anything is not needed (even on 
6.x), because something that does not match anything does not produce any score 
that could have wrongly normalized :-)

I will commit the simplification patch on master later on.

> BooleanQuery rewrite optimizations
> ----------------------------------
>
>                 Key: LUCENE-7416
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7416
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: master (7.0)
>            Reporter: Spyros Kapnissis
>            Priority: Minor
>             Fix For: master (7.0), 6.3
>
>         Attachments: LUCENE-7146-simplific1.patch, 
> LUCENE-7146-simplific1.patch, LUCENE-7146.patch
>
>
> A couple of BooleanQuery rewrites / optimizations. 
> First, as discussed on the user group, a BooleanQuery with a query that is 
> both a SHOULD and a FILTER can be rewritten as a single MUST query, but care 
> must be taken to decrement minShouldMatch by 1.
> Another case is if a query is both required (MUST or FILTER) and MUST_NOT at 
> the same time, it can be converted to a MatchNoDocsQuery (although I haven't 
> discussed this yet so hopefully I'm not missing something!).



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

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

Reply via email to