Lucene - Core
  1. Lucene - Core
  2. LUCENE-5530

ComplexPhraseQueryParser throws ParseException for fielded queries

    Details

    • Lucene Fields:
      New, Patch Available

      Description

      Queries using QueryParser's non-default field e.g.
      author:"j* smith" are not supported by ComplexPhraseQueryParser. For example following code snippet

      ComplexPhraseQueryParser qp = new ComplexPhraseQueryParser(TEST_VERSION_CURRENT, "defaultField", new MockAnalyzer(new Random()));
            qp.parse("author:\"fred* smith\"") ;
      

      yields

      Caused by: org.apache.lucene.queryparser.classic.ParseException: Cannot have clause for field "defaultField" nested in phrase  for field "author"
      	at org.apache.lucene.queryparser.complexPhrase.ComplexPhraseQueryParser.checkPhraseClauseIsForSameField(ComplexPhraseQueryParser.java:147)
      	at org.apache.lucene.queryparser.complexPhrase.ComplexPhraseQueryParser.newTermQuery(ComplexPhraseQueryParser.java:135)
      	... 49 more
      
      1. LUCENE-5530.patch
        5 kB
        Ahmet Arslan
      2. LUCENE-5530.patch
        5 kB
        Ahmet Arslan

        Activity

        Hide
        Ahmet Arslan added a comment -

        Bring fielded query support by changing the visibility of "field" in the QueryParserBase class from "package-private" to "protected".

        Show
        Ahmet Arslan added a comment - Bring fielded query support by changing the visibility of "field" in the QueryParserBase class from "package-private" to "protected".
        Hide
        Ahmet Arslan added a comment -

        Remove role:"de*" type queries from text case. One term inside quotes is somehow meaningless.

        Show
        Ahmet Arslan added a comment - Remove role:"de*" type queries from text case. One term inside quotes is somehow meaningless.
        Hide
        Erick Erickson added a comment -

        Tomas' patch from LUCENE-1486 so we can start iterating.

        Show
        Erick Erickson added a comment - Tomas' patch from LUCENE-1486 so we can start iterating.
        Hide
        Erick Erickson added a comment -

        Bah! Ahmet is waaaay ahead of me! Removed the patch I just uploaded to reduce confusion.

        Show
        Erick Erickson added a comment - Bah! Ahmet is waaaay ahead of me! Removed the patch I just uploaded to reduce confusion.
        Hide
        ASF subversion and git services added a comment -

        Commit 1578148 from Erick Erickson in branch 'dev/trunk'
        [ https://svn.apache.org/r1578148 ]

        LUCENE-5530 Allow the ComplexPhraseQueryParser to search order or un-order proximity queries.

        Show
        ASF subversion and git services added a comment - Commit 1578148 from Erick Erickson in branch 'dev/trunk' [ https://svn.apache.org/r1578148 ] LUCENE-5530 Allow the ComplexPhraseQueryParser to search order or un-order proximity queries.
        Hide
        ASF subversion and git services added a comment -

        Commit 1578158 from Erick Erickson in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1578158 ]

        LUCENE-5530 Allow the ComplexPhraseQueryParser to search order or un-order proximity queries.

        Show
        ASF subversion and git services added a comment - Commit 1578158 from Erick Erickson in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1578158 ] LUCENE-5530 Allow the ComplexPhraseQueryParser to search order or un-order proximity queries.
        Hide
        Erick Erickson added a comment -

        Thanks Ahmet!

        Show
        Erick Erickson added a comment - Thanks Ahmet!
        Hide
        Uwe Schindler added a comment -

        Close issue after release of 4.8.0

        Show
        Uwe Schindler added a comment - Close issue after release of 4.8.0

          People

          • Assignee:
            Erick Erickson
            Reporter:
            Ahmet Arslan
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development