lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3238) SpanMultiTermQueryWrapper with Prefix Query issue
Date Fri, 24 Jun 2011 14:23:47 GMT


Uwe Schindler commented on LUCENE-3238:

The fix is fine, but in my optinion the problem should be solved differently.

I would like to make the rewrite method in MultiTermQuery final to prevent override. To correctly
fix the issue, WildcardQuery only needs to return a PrefixTermEnum in its getEnum method.
This is already fixed in Lucene 4.0.

>From looking at the code, SpanMultiTermQueryWrapper would not work correct in all cases,
if the underlying query overwrites rewrite(), as the rewritten query would again have the
wrong type.

> SpanMultiTermQueryWrapper with Prefix Query issue
> -------------------------------------------------
>                 Key: LUCENE-3238
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: core/search
>    Affects Versions: 3.3
>         Environment: Windows 7, JDK 1.6
>            Reporter: ludovic Boutros
>            Assignee: Robert Muir
>         Attachments: LUCENE-3238.patch, LUCENE-3238.patch
> 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.

This message is automatically generated by JIRA.
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message