lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] Updated: (LUCENE-1951) wildcardquery rewrite improvements
Date Wed, 07 Oct 2009 21:41:31 GMT


Robert Muir updated LUCENE-1951:

    Attachment: LUCENE-1951.patch

patch for these issues.
note: the existing TestWildCardQuery.testTermWithoutWildcard had a bad test, and needs to
be fixed for bw-compat branch.

it did the following:
Query wq = new WildcardQuery(new Term("field", "nowildcard"));
wq = searcher.rewrite(wq);
assertTrue(wq instanceof TermQuery);

this is not correct, it should only be TermQuery when rewriteMethod is SCORING_BOOLEAN_QUERY_REWRITE.
and this is not the default, constant score is.

easiest way to fix the old test is to setRewriteMethod(SCORING_BOOLEAN_QUERY_REWRITE), its
the only time it should rewrite to TermQuery.

> wildcardquery rewrite improvements
> ----------------------------------
>                 Key: LUCENE-1951
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Query/Scoring
>            Reporter: Robert Muir
>            Priority: Minor
>         Attachments: LUCENE-1951.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