Lucene - Core
  1. Lucene - Core
  2. LUCENE-6298

empty SimpleQueryParser query should return empty BooleanQuery

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.1, 6.0
    • Component/s: modules/queryparser
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      In order to be consistent with QueryParser, SimpleQueryParser should return an empty BooleanQuery instead of null when the analyzed query state is null (if the query text is entirely removed during analysis, for instance).

      Long term it would also be nice to be able to return a MatchNoDocsQuery (or something like that) instead of using null as a stand-in value for this.

      1. LUCENE-6298.patch
        3 kB
        Lee Hinman
      2. LUCENE-6298.patch
        4 kB
        Lee Hinman

        Activity

        Hide
        Lee Hinman added a comment -

        Small patch that changes the SimpleQueryParser to the desired behavior

        Show
        Lee Hinman added a comment - Small patch that changes the SimpleQueryParser to the desired behavior
        Hide
        Lee Hinman added a comment -

        Better patch without all the stupid IDE import changes.

        Show
        Lee Hinman added a comment - Better patch without all the stupid IDE import changes.
        Hide
        Robert Muir added a comment -

        +1

        great to remove this trap (only happens in rare circumstances)

        Show
        Robert Muir added a comment - +1 great to remove this trap (only happens in rare circumstances)
        Hide
        Michael McCandless added a comment -

        +1

        Show
        Michael McCandless added a comment - +1
        Hide
        Robert Muir added a comment -

        Thanks Lee!

        Show
        Robert Muir added a comment - Thanks Lee!
        Hide
        ASF subversion and git services added a comment -

        Commit 1662564 from Robert Muir in branch 'dev/trunk'
        [ https://svn.apache.org/r1662564 ]

        LUCENE-6298: SimpleQueryParser returns empty query rather than null for empty query

        Show
        ASF subversion and git services added a comment - Commit 1662564 from Robert Muir in branch 'dev/trunk' [ https://svn.apache.org/r1662564 ] LUCENE-6298 : SimpleQueryParser returns empty query rather than null for empty query
        Hide
        ASF subversion and git services added a comment -

        Commit 1662567 from Robert Muir in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1662567 ]

        LUCENE-6298: SimpleQueryParser returns empty query rather than null for empty query

        Show
        ASF subversion and git services added a comment - Commit 1662567 from Robert Muir in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1662567 ] LUCENE-6298 : SimpleQueryParser returns empty query rather than null for empty query
        Hide
        Timothy Potter added a comment -

        Bulk close after 5.1 release

        Show
        Timothy Potter added a comment - Bulk close after 5.1 release

          People

          • Assignee:
            Unassigned
            Reporter:
            Lee Hinman
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development