public abstract class AbstractVisitingPrefixTreeQuery.VisitorTemplate extends AbstractPrefixTreeQuery.BaseTermsEnumTraverser
SpatialPrefixTree indexed field. An instance
of this class is not designed to be re-used across LeafReaderContext
instances so simply create a new one per-leaf.
The getDocIdSet() method here starts the work. It first checks
that there are indexed terms; if not it quickly returns null. Then it calls
start() so a subclass can set up a return value, like an
FixedBitSet. Then it starts the traversal
process, calling findSubCellsToVisit(org.apache.lucene.spatial.prefix.tree.Cell)
which by default finds the top cells that intersect queryShape. If
there isn't an indexed cell for a corresponding cell returned for this
method then it's short-circuited until it finds one, at which point
visitPrefix(org.apache.lucene.spatial.prefix.tree.Cell) is called. At
some depths, of the tree, the algorithm switches to a scanning mode that
calls visitScanned(org.apache.lucene.spatial.prefix.tree.Cell)
for each leaf cell found.context, maxDoc, postingsEnum, terms, termsEnum| Constructor and Description |
|---|
VisitorTemplate(LeafReaderContext context) |
| Modifier and Type | Method and Description |
|---|---|
protected CellIterator |
findSubCellsToVisit(Cell cell)
Called when doing a divide and conquer to find the next intersecting cells
of the query shape that are beneath
cell. |
protected abstract DocIdSet |
finish()
Called last to return the result.
|
DocIdSet |
getDocIdSet() |
protected void |
postSiblings(AbstractVisitingPrefixTreeQuery.VNode vNode) |
protected void |
preSiblings(AbstractVisitingPrefixTreeQuery.VNode vNode) |
protected void |
scan(int scanDetailLevel)
Scans (
termsEnum.next()) terms until a term is found that does
not start with curVNode's cell. |
protected abstract void |
start()
Called first to setup things.
|
protected abstract void |
visitLeaf(Cell cell)
Called when an indexed leaf cell is found.
|
protected abstract boolean |
visitPrefix(Cell cell)
Visit an indexed non-leaf cell.
|
protected void |
visitScanned(Cell cell)
The cell is either indexed as a leaf or is the last level of detail.
|
collectDocs, collectDocspublic VisitorTemplate(LeafReaderContext context) throws java.io.IOException
java.io.IOExceptionpublic DocIdSet getDocIdSet() throws java.io.IOException
java.io.IOExceptionprotected CellIterator findSubCellsToVisit(Cell cell)
cell. cell is
guaranteed to have an intersection and thus this must return some number
of nodes.protected void scan(int scanDetailLevel)
throws java.io.IOException
termsEnum.next()) terms until a term is found that does
not start with curVNode's cell. If it finds a leaf cell or a cell at
level scanDetailLevel then it calls visitScanned(org.apache.lucene.spatial.prefix.tree.Cell).java.io.IOExceptionprotected abstract void start()
throws java.io.IOException
java.io.IOExceptionprotected abstract DocIdSet finish() throws java.io.IOException
java.io.IOExceptionprotected abstract boolean visitPrefix(Cell cell) throws java.io.IOException
Cell.getShapeRel() set
relative to the filtered shape.cell - An intersecting cell; not a leaf.java.io.IOExceptionprotected abstract void visitLeaf(Cell cell) throws java.io.IOException
java.io.IOExceptionprotected void visitScanned(Cell cell) throws java.io.IOException
visitLeaf(org.apache.lucene.spatial.prefix.tree.Cell) or
visitPrefix(org.apache.lucene.spatial.prefix.tree.Cell).java.io.IOExceptionprotected void preSiblings(AbstractVisitingPrefixTreeQuery.VNode vNode) throws java.io.IOException
java.io.IOExceptionprotected void postSiblings(AbstractVisitingPrefixTreeQuery.VNode vNode) throws java.io.IOException
java.io.IOExceptionCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.