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

StandardQueryParser doesn't support pure negative clauses

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.10.3, 5.0
    • 4.10.5, 5.1, 6.0
    • None
    • None
    • 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

        1. LUCENE-6249.patch
          16 kB
          Dawid Weiss

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: