Lucene - Core
  1. Lucene - Core
  2. LUCENE-933

QueryParser can produce empty sub BooleanQueries when Analyzer proudces no tokens for input


    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Lucene Fields:
      Patch Available


      as triggered by SOLR-261, if you have a query like this...

      +foo:BBB +(yak:AAA baz:CCC)

      ...where the analyzer produces no tokens for the "yak:AAA" or "baz:CCC" portions of the query (posisbly because they are stop words) the resulting query produced by the QueryParser will be...

      +foo:BBB +()

      ...that is a BooleanQuery with two required clauses, one of which is an empty BooleanQuery with no clauses.

      this does not appear to be "good" behavior.

      In general, QueryParser should be smarter about what it does when parsing encountering parens whose contents result in an empty BooleanQuery – but what exactly it should do in the following situations...

      a) +foo:BBB +()
      b) +foo:BBB ()
      c) +foo:BBB -() up for interpretation. I would think situation (b) clearly lends itself to dropping the sub-BooleanQuery completely. situation (c) may also lend itself to that solution, since semanticly it means "don't allow a match on any queries in the empty set of queries". .... I have no idea what the "right" thing to do for situation (a) is.

        Issue Links


          Hoss Man created issue -
          Hoss Man made changes -
          Field Original Value New Value
          Link This issue blocks SOLR-261 [ SOLR-261 ]
          Doron Cohen made changes -
          Assignee Doron Cohen [ doronc ]
          Doron Cohen made changes -
          Attachment lucene-933_backwards_comapatible.patch [ 12360237 ]
          Attachment lucene-933_nullify.patch [ 12360238 ]
          Doron Cohen made changes -
          Lucene Fields [New] [Patch Available]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Mark Thomas made changes -
          Workflow jira [ 12406438 ] Default workflow, editable Closed status [ 12562556 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12562556 ] jira [ 12583519 ]


            • Assignee:
              Doron Cohen
              Hoss Man
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: