[
https://issues.apache.org/jira/browse/LUCENE-6249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14978114#comment-14978114
]
Jigar Shah commented on LUCENE-6249:
------------------------------------
It seems this fix is very important considering the following case, it returns
hits when it should not return, to me it seems a major bug.
lottery AND (NOT ticket)
Lucene 4.10.3: +lottery +ticket [Incorrect] gives results just because its
parsed incorrectly.
Lucene 5.2.0: +lottery +(-ticket) [Correct]
And this fix seems to be safe for 4.10 version !! I am not in hurry to get
this, But it will be helpful in case some production systems are on 4.x
version, and don't want to re-index there database for 5.x just for query
parser change.
> StandardQueryParser doesn't support pure negative clauses
> ---------------------------------------------------------
>
> Key: LUCENE-6249
> URL: https://issues.apache.org/jira/browse/LUCENE-6249
> Project: Lucene - Core
> Issue Type: Bug
> Affects Versions: 4.10.3, 5.0
> Reporter: Dawid Weiss
> Assignee: Dawid Weiss
> Fix For: 5.1, Trunk
>
> Attachments: LUCENE-6249.patch
>
>
> At first I thought it's by design but Uwe says it's a bug. SQP emits this:
> {code}
> StandardQueryParser qp = new StandardQueryParser();
> qp.setDefaultOperator(Operator.AND);
>
> System.out.println(qp.parse("summary:foo", "deffld"));
> System.out.println(qp.parse("-summary:foo", "deffld"));
> System.out.println(qp.parse("!summary:foo", "deffld"));
> System.out.println(qp.parse("NOT summary:foo", "deffld"));
> {code}
> {code}
> summary:foo
> summary:foo
> summary:foo
> summary:foo
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]