mirror of https://github.com/apache/lucene.git
Patched to fix a bug when empty indexes or segments exist.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@149859 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
474d9de985
commit
933bac2435
|
@ -125,9 +125,13 @@ final class SegmentsReader extends IndexReader
|
||||||
hi = mid - 1;
|
hi = mid - 1;
|
||||||
else if (n > midValue)
|
else if (n > midValue)
|
||||||
lo = mid + 1;
|
lo = mid + 1;
|
||||||
else
|
else { // found a match
|
||||||
|
while (mid+1 < readers.length && starts[mid+1] == midValue) {
|
||||||
|
mid++; // scan to last match
|
||||||
|
}
|
||||||
return mid;
|
return mid;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return hi;
|
return hi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,9 +116,13 @@ public class MultiSearcher extends Searcher implements Searchable {
|
||||||
hi = mid - 1;
|
hi = mid - 1;
|
||||||
else if (n > midValue)
|
else if (n > midValue)
|
||||||
lo = mid + 1;
|
lo = mid + 1;
|
||||||
else
|
else { // found a match
|
||||||
|
while (mid+1 < searchables.length && starts[mid+1] == midValue) {
|
||||||
|
mid++; // scan to last match
|
||||||
|
}
|
||||||
return mid;
|
return mid;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return hi;
|
return hi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue