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,8 +125,12 @@ final class SegmentsReader extends IndexReader
|
|||
hi = mid - 1;
|
||||
else if (n > midValue)
|
||||
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 hi;
|
||||
}
|
||||
|
|
|
@ -116,8 +116,12 @@ public class MultiSearcher extends Searcher implements Searchable {
|
|||
hi = mid - 1;
|
||||
else if (n > midValue)
|
||||
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 hi;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue