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 java.lang.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
Fields Modifier and Type Field Description private DocIdSetBuilder.BulkAdderadderprivate PrefixCodedTerms.TermIteratoriteratorprivate BytesRefnextQueryPointprivate DocIdSetBuilderresultprivate BytesRefscratchprivate PrefixCodedTermssortedPackedPoints
-
Constructor Summary
Constructors Constructor Description MergePointVisitor(PrefixCodedTerms sortedPackedPoints, DocIdSetBuilder result)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PointValues.Relationcompare(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.voidgrow(int count)Notifies the caller that this many documents are about to be visitedprivate booleanmatches(byte[] packedValue)voidvisit(int docID)Called for all documents in a leaf cell that's fully contained by the query.voidvisit(int docID, byte[] packedValue)Called for all documents in a leaf cell that crosses the query.voidvisit(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 Detail
-
result
private final DocIdSetBuilder result
-
iterator
private PrefixCodedTerms.TermIterator iterator
-
nextQueryPoint
private BytesRef nextQueryPoint
-
scratch
private final BytesRef scratch
-
sortedPackedPoints
private final PrefixCodedTerms sortedPackedPoints
-
adder
private DocIdSetBuilder.BulkAdder adder
-
-
Constructor Detail
-
MergePointVisitor
public MergePointVisitor(PrefixCodedTerms sortedPackedPoints, DocIdSetBuilder result) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
grow
public void grow(int count)
Description copied from interface:PointValues.IntersectVisitorNotifies the caller that this many documents are about to be visited- Specified by:
growin interfacePointValues.IntersectVisitor
-
visit
public void visit(int docID)
Description copied from interface:PointValues.IntersectVisitorCalled for all documents in a leaf cell that's fully contained by the query. The consumer should blindly accept the docID.- Specified by:
visitin interfacePointValues.IntersectVisitor
-
visit
public void visit(int docID, byte[] packedValue)Description copied from interface:PointValues.IntersectVisitorCalled 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:
visitin interfacePointValues.IntersectVisitor
-
visit
public void visit(DocIdSetIterator iterator, byte[] packedValue) throws java.io.IOException
Description copied from interface:PointValues.IntersectVisitorSimilar 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:
visitin interfacePointValues.IntersectVisitor- Throws:
java.io.IOException
-
matches
private boolean matches(byte[] packedValue)
-
compare
public PointValues.Relation compare(byte[] minPackedValue, byte[] maxPackedValue)
Description copied from interface:PointValues.IntersectVisitorCalled for non-leaf cells to test how the cell relates to the query, to determine how to further recurse down the tree.- Specified by:
comparein interfacePointValues.IntersectVisitor
-
-