lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Commented: (LUCENE-1951) wildcardquery rewrite improvements
Date Thu, 08 Oct 2009 09:31:31 GMT


Michael McCandless commented on LUCENE-1951:

Patch looks good, thanks Robert!  And those are good perf numbers;
rewriting to PrefixQuery seems a clear win.

The only thing that makes me nervous here is we've baked-in MTQ's
rewrite logic into WildcardQuery.rewrite.  Ie, MTQ in general accepts
any rewrite method, and so conceivably one could create their own
rewrite method and then see that it's unused in the special case where
WildcardQuery is a single term.

And while it's true today that if the rewrite method != scoring
boolean query, it must be a constant scoring one, that could
conceivably some day change.

Maybe a different approach would be to make a degenerate
"SingleTermEnum" (subclasses FilteredTermEnum) that produces only a
single term?  Then in getEnum we could return that, instead, so the
rewrite method remains intact?

> wildcardquery rewrite improvements
> ----------------------------------
>                 Key: LUCENE-1951
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Query/Scoring
>            Reporter: Robert Muir
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1951.patch, LUCENE-1951_bwcompatbranch.patch
> wildcardquery has logic to rewrite to termquery if there is no wildcard character, but
> * it needs to pass along the boost if it does this
> * if the user asked for a 'constant score' rewriteMethod, it should rewrite to a constant
score query for consistency.
> additionally, if the query is really a prefixquery, it would be nice to rewrite to prefix
> both will enumerate the same number of terms, but prefixquery has a simpler comparison

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message