Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6249

StandardQueryParser doesn't support pure negative clauses

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.10.3, 5.0
    • Fix Version/s: 4.10.5, 5.1, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      At first I thought it's by design but Uwe says it's a bug. SQP emits this:

      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"));
      
      summary:foo
      summary:foo
      summary:foo
      summary:foo
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dweiss Dawid Weiss
                Reporter:
                dweiss Dawid Weiss
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: