Lucene - Core
  1. Lucene - Core
  2. LUCENE-3238

SpanMultiTermQueryWrapper with Prefix Query issue

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.3
    • Component/s: core/search
    • Labels:
      None
    • Environment:

      Windows 7, JDK 1.6

    • Lucene Fields:
      New, Patch Available

      Description

      If we try to do a search with SpanQuery and a PrefixQuery this message is returned:

      "You can only use SpanMultiTermQueryWrapper with a suitable SpanRewriteMethod."

      The problem is in the WildcardQuery rewrite function.

      If the wildcard query is a prefix, a new prefix query is created, the rewrite method is set with the SpanRewriteMethod and the prefix query is returned.

      But, that's the rewritten prefix query which should be returned:

      • return rewritten;
        + return rewritten.rewrite(reader);

      I will attach a patch with a unit test included.

      1. LUCENE-3238.patch
        8 kB
        Robert Muir
      2. LUCENE-3238.patch
        4 kB
        Robert Muir
      3. LUCENE-3238.patch
        2 kB
        ludovic Boutros

        Activity

        ludovic Boutros created issue -
        ludovic Boutros made changes -
        Field Original Value New Value
        Attachment LUCENE-3238.patch [ 12483710 ]
        Robert Muir made changes -
        Assignee Robert Muir [ rcmuir ]
        Robert Muir made changes -
        Attachment LUCENE-3238.patch [ 12483712 ]
        Robert Muir made changes -
        Attachment LUCENE-3238.patch [ 12483715 ]
        Robert Muir made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 3.3 [ 12316470 ]
        Robert Muir made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Robert Muir
            Reporter:
            ludovic Boutros
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development