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

SpanNotQuery has bug?

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 5.3.1
    • Fix Version/s: None
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      i find when use SpanNotQuery and the exclud key word like "not" "or" will give a error result

      example:
      doc1:the quick brown fox jumps over the lazy dog
      doc2:the quick red fox jumps over the sleepy cat
      doc3:the quick brown fox jumps over the lazy NOT dog

      String queryStringStart = "dog";
      String queryStringEnd = "quick";
      String excludeString = "NOT";
      SpanQuery queryStart = new SpanTermQuery(new Term("text",queryStringStart));
      SpanQuery queryEnd = new SpanTermQuery(new Term("text",queryStringEnd));
      SpanQuery excludeQuery = new SpanTermQuery(new Term("text",excludeString));
      SpanQuery spanNearQuery = new SpanNearQuery(
      new SpanQuery[]

      {queryStart,queryEnd}

      , 7, false, false);

      SpanNotQuery spanNotQuery = new SpanNotQuery(spanNearQuery, excludeQuery, 4,3);

      then this will return doc1 and doc3. so i think it is a bug.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jj380382856 jin jing
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: