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

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 6.3
    • None
    • core/queryparser
    • None
    • 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

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

            Dates

              Created:
              Updated: