mirror of https://github.com/apache/lucene.git
LUCENE-6022: DocValuesDocIdSet checks live docs before doc values.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1633879 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ad9fb9a9dd
commit
62ed868f2a
|
@ -243,6 +243,9 @@ Optimizations
|
||||||
* LUCENE-5983: CachingWrapperFilter now uses a new DocIdSet implementation
|
* LUCENE-5983: CachingWrapperFilter now uses a new DocIdSet implementation
|
||||||
called RoaringDocIdSet instead of WAH8DocIdSet. (Adrien Grand)
|
called RoaringDocIdSet instead of WAH8DocIdSet. (Adrien Grand)
|
||||||
|
|
||||||
|
* LUCENE-6022: DocValuesDocIdSet checks live docs before doc values.
|
||||||
|
(Adrien Grand)
|
||||||
|
|
||||||
Build
|
Build
|
||||||
|
|
||||||
* LUCENE-5909: Smoke tester now has better command line parsing and
|
* LUCENE-5909: Smoke tester now has better command line parsing and
|
||||||
|
|
|
@ -27,8 +27,7 @@ import org.apache.lucene.util.FixedBitSet;
|
||||||
* of its iterator is very stupid and slow if the implementation of the
|
* of its iterator is very stupid and slow if the implementation of the
|
||||||
* {@link #matchDoc} method is not optimized, as iterators simply increment
|
* {@link #matchDoc} method is not optimized, as iterators simply increment
|
||||||
* the document id until {@code matchDoc(int)} returns true. Because of this
|
* the document id until {@code matchDoc(int)} returns true. Because of this
|
||||||
* {@code matchDoc(int)} must be as fast as possible and in no case do any
|
* {@code matchDoc(int)} must be as fast as possible.
|
||||||
* I/O.
|
|
||||||
* @lucene.internal
|
* @lucene.internal
|
||||||
*/
|
*/
|
||||||
public abstract class DocValuesDocIdSet extends DocIdSet {
|
public abstract class DocValuesDocIdSet extends DocIdSet {
|
||||||
|
@ -66,7 +65,7 @@ public abstract class DocValuesDocIdSet extends DocIdSet {
|
||||||
} : new Bits() {
|
} : new Bits() {
|
||||||
@Override
|
@Override
|
||||||
public boolean get(int docid) {
|
public boolean get(int docid) {
|
||||||
return matchDoc(docid) && acceptDocs.get(docid);
|
return acceptDocs.get(docid) && matchDoc(docid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -135,19 +134,13 @@ public abstract class DocValuesDocIdSet extends DocIdSet {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int nextDoc() {
|
public int nextDoc() {
|
||||||
do {
|
return advance(doc + 1);
|
||||||
doc++;
|
|
||||||
if (doc >= maxDoc) {
|
|
||||||
return doc = NO_MORE_DOCS;
|
|
||||||
}
|
|
||||||
} while (!(matchDoc(doc) && acceptDocs.get(doc)));
|
|
||||||
return doc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int advance(int target) {
|
public int advance(int target) {
|
||||||
for(doc=target; doc<maxDoc; doc++) {
|
for(doc=target; doc<maxDoc; doc++) {
|
||||||
if (matchDoc(doc) && acceptDocs.get(doc)) {
|
if (acceptDocs.get(doc) && matchDoc(doc)) {
|
||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue