mirror of https://github.com/apache/lucene.git
fix buggy 'advance called before nextDoc' case
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1663186 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a9915c6616
commit
959dfcb7de
|
@ -149,6 +149,12 @@ class TermAutomatonScorer extends Scorer {
|
|||
|
||||
@Override
|
||||
public int advance(int target) throws IOException {
|
||||
if (docID == -1) {
|
||||
popCurrentDoc();
|
||||
if (docID >= target) {
|
||||
return doNext();
|
||||
}
|
||||
}
|
||||
for(int i=0;i<numSubsOnDoc;i++) {
|
||||
EnumAndScorer sub = subsOnDoc[i];
|
||||
if (sub.posEnum.advance(target) != NO_MORE_DOCS) {
|
||||
|
|
|
@ -578,6 +578,9 @@ public class TestTermAutomatonQuery extends LuceneTestCase {
|
|||
Query q1 = q;
|
||||
Query q2 = bq;
|
||||
if (random().nextInt(5) == 1) {
|
||||
if (VERBOSE) {
|
||||
System.out.println(" use random filter");
|
||||
}
|
||||
RandomFilter filter = new RandomFilter(random().nextLong(), random().nextFloat());
|
||||
q1 = new FilteredQuery(q1, filter);
|
||||
q2 = new FilteredQuery(q2, filter);
|
||||
|
|
Loading…
Reference in New Issue