Lucene - Core
  1. Lucene - Core
  2. LUCENE-2262

QueryParser should now allow leading '?' wildcards

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.0-ALPHA
    • Fix Version/s: 4.9, 5.0
    • Component/s: core/queryparser
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      QueryParser currently throws an exception if a wildcard term begins with the '?' operator.

      The current documentation describes why this is:

      When set, * or ? are allowed as the first character of a PrefixQuery and WildcardQuery.
      Note that this can produce very slow queries on big indexes. 
      

      In the flexible indexing branch, wildcard queries with leading '?' operator are no longer slow on big indexes (they do not enumerate terms in linear fashion).
      Thus, it no longer makes sense to throw a ParseException for a leading '?'

      So, users should be able to perform a query of "?foo" and no longer get a ParseException from the QueryParser.

      For the flexible indexing branch, wildcard queries of 'foo?', '?foo', 'f?oo', etc are all the same from a performance perspective.

      1. LUCENE-2262_backwards.patch
        0.9 kB
        Robert Muir
      2. LUCENE-2262.patch
        9 kB
        Robert Muir

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Robert Muir
            Reporter:
            Robert Muir
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development