lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Miller (JIRA)" <>
Subject [jira] Commented: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
Date Mon, 15 Jun 2009 16:16:07 GMT


Mark Miller commented on LUCENE-1599:

Something is modifying the original query itself.

In MultiSearcher.rewrite:

  public Query rewrite(Query original) throws IOException {
    Query[] queries = new Query[searchables.length];
    for (int i = 0; i < searchables.length; i++) {
      queries[i] = searchables[i].rewrite(original);
    return queries[0].combine(queries);

On the first time through the loop, the SpanRegexQuery will contain the regex pattern, but
the first time it hits rewrite, it will be changed to the expanded query. This shouldnt happen.
On the next time through the loop, original query will not contain a regex pattern, but will
instead be the first time through the loop's rewritten query. Oddness.

I'll dig in and try and fix for 2.9.

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>                 Key: LUCENE-1599
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>             Fix For: 2.9
>         Attachments:
>   Original Estimate: 2h
>  Remaining Estimate: 2h
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first
IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

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