[
https://issues.apache.org/jira/browse/LUCENE-7483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15555228#comment-15555228
]
Yonik Seeley commented on LUCENE-7483:
--------------------------------------
This is known/expected behavior since as long as the query parser has been
around.
IIRC Erik tackled this back in 2004-2005 and created a precedence query parser
that would implement normal boolean precedence/logic.
I don't know if that code is still around, but the behavior was copied as a
variant of the "flexible" query parser work done much later:
See PrecedenceQueryParser class:
{code}
This query parser works exactly as the standard query parser (
StandardQueryParser ), except that it respect the boolean precedence, so <a AND
b OR c AND d> is parsed to <(+a +b) (+c +d)> instead of <+a +b +c +d>.
{code}
> QueryParser changes OR clausule to AND
> --------------------------------------
>
> Key: LUCENE-7483
> URL: https://issues.apache.org/jira/browse/LUCENE-7483
> Project: Lucene - Core
> Issue Type: Bug
> Components: core/queryparser
> Affects Versions: 6.2.1
> Reporter: Júlio César e Melo
> Priority: Minor
>
> QueryParser incorrectly parses the expression {color:blue}{{t1 AND t2 *OR* t3
> AND t4}}{color} as
> {color:red}{{(+t1 +t2 +t3 +t4)}}{color} while {color:green}{{t1 AND t2 AND t3
> AND t4}}{color} produces the same result.
> The expected result for expression {color:blue}{{t1 AND t2 OR t3 AND
> t4}}{color} is {color:purple}{{(+t1 +t2) (+t3 +t4)}}{color}.
> This occurs using StandardQueryParser or classic.QueryParser.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]