[
https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718948#action_12718948
]
Billow Gao commented on LUCENE-1599:
------------------------------------
Not there.
If you use the query one those two IndexSearcher one by one, then you will find
that only the first search has a match.
The second one always fail.
For example:
SpanRegexQuery srq = new SpanRegexQuery(new Term("field", "a.*"));
SpanRegexQuery stq = new SpanRegexQuery(new Term("field", "b.*"));
SpanNearQuery query = new SpanNearQuery(new SpanQuery[] { srq, stq },
6, true);
IndexSearcher[] arrSearcher = new IndexSearcher[2];
arrSearcher[0] = new IndexSearcher(indexStoreA);
arrSearcher[1] = new IndexSearcher(indexStoreB);
Hits hits = arrSearcher[0].search(query);
assertEquals(1, hits.length());
hits = arrSearcher[1].search(query);
//fail here because query rewrite will not use new term.
//The problem should sit inside spanquery, maybe it only call rewrite function
once.
//Anyway, I didn't check its source code yet.
assertEquals(1, hits.length());
arrSearcher[0].close();
arrSearcher[1].close();
> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
> Key: LUCENE-1599
> URL: https://issues.apache.org/jira/browse/LUCENE-1599
> 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: TestSpanRegexBug.java
>
> 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: [email protected]
For additional commands, e-mail: [email protected]