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

MultiFieldQueryParser does not honor default operator when there is a special character

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 6.3
    • Fix Version/s: None
    • Component/s: core/queryparser
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      simple code snippet

      MultiFieldQueryParser mp = new MultiFieldQueryParser(new String[]

      {"test"}

      , new StandardAnalyzer());
      mp.setDefaultOperator(Operator.AND);
      System.out.println(mp.parse(qstring));

      if qstring is just 2 tokens, e.g: "you me", behavior is correct:

      +(test:you) +(test:me)

      now if qstring contains 2 tokens connected by a special char, e.g.: "you&me", behavior is always OR, e.g.

      (test:you) (test:me)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              john.wang@gmail.com John Wang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: