Module org.apache.lucene.core
Package org.apache.lucene.search
Class PointInSetQuery.MergePointVisitor
java.lang.Object
org.apache.lucene.search.PointInSetQuery.MergePointVisitor
- All Implemented Interfaces:
PointValues.IntersectVisitor
- Enclosing class:
PointInSetQuery
private class PointInSetQuery.MergePointVisitor
extends Object
implements PointValues.IntersectVisitor
Essentially does a merge sort, only collecting hits when the indexed point and query point are
the same. This is an optimization, used in the 1D case.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DocIdSetBuilder.BulkAdder
private final ArrayUtil.ByteArrayComparator
private PrefixCodedTerms.TermIterator
private BytesRef
private final DocIdSetBuilder
private final PrefixCodedTerms
-
Constructor Summary
ConstructorsConstructorDescriptionMergePointVisitor
(PrefixCodedTerms sortedPackedPoints, DocIdSetBuilder result) -
Method Summary
Modifier and TypeMethodDescriptioncompare
(byte[] minPackedValue, byte[] maxPackedValue) Called for non-leaf cells to test how the cell relates to the query, to determine how to further recurse down the tree.void
grow
(int count) Notifies the caller that this many documents are about to be visitedprivate boolean
matches
(byte[] packedValue) void
visit
(int docID) Called for all documents in a leaf cell that's fully contained by the query.void
visit
(int docID, byte[] packedValue) Called for all documents in a leaf cell that crosses the query.void
visit
(DocIdSetIterator iterator) Similar toPointValues.IntersectVisitor.visit(int)
, but a bulk visit and implements may have their optimizations.void
visit
(DocIdSetIterator iterator, byte[] packedValue) Similar toPointValues.IntersectVisitor.visit(int, byte[])
but in this case the packedValue can have more than one docID associated to it.
-
Field Details
-
result
-
iterator
-
nextQueryPoint
-
comparator
-
sortedPackedPoints
-
adder
-
-
Constructor Details
-
MergePointVisitor
public MergePointVisitor(PrefixCodedTerms sortedPackedPoints, DocIdSetBuilder result) throws IOException - Throws:
IOException
-
-
Method Details
-
grow
public void grow(int count) Description copied from interface:PointValues.IntersectVisitor
Notifies the caller that this many documents are about to be visited- Specified by:
grow
in interfacePointValues.IntersectVisitor
-
visit
public void visit(int docID) Description copied from interface:PointValues.IntersectVisitor
Called for all documents in a leaf cell that's fully contained by the query. The consumer should blindly accept the docID.- Specified by:
visit
in interfacePointValues.IntersectVisitor
-
visit
Description copied from interface:PointValues.IntersectVisitor
Similar toPointValues.IntersectVisitor.visit(int)
, but a bulk visit and implements may have their optimizations.- Specified by:
visit
in interfacePointValues.IntersectVisitor
- Throws:
IOException
-
visit
public void visit(int docID, byte[] packedValue) Description copied from interface:PointValues.IntersectVisitor
Called for all documents in a leaf cell that crosses the query. The consumer should scrutinize the packedValue to decide whether to accept it. In the 1D case, values are visited in increasing order, and in the case of ties, in increasing docID order.- Specified by:
visit
in interfacePointValues.IntersectVisitor
-
visit
Description copied from interface:PointValues.IntersectVisitor
Similar toPointValues.IntersectVisitor.visit(int, byte[])
but in this case the packedValue can have more than one docID associated to it. The provided iterator should not escape the scope of this method so that implementations of PointValues are free to reuse it,- Specified by:
visit
in interfacePointValues.IntersectVisitor
- Throws:
IOException
-
matches
private boolean matches(byte[] packedValue) -
compare
Description copied from interface:PointValues.IntersectVisitor
Called for non-leaf cells to test how the cell relates to the query, to determine how to further recurse down the tree.- Specified by:
compare
in interfacePointValues.IntersectVisitor
-