public abstract class AbstractVisitingPrefixTreeFilter.VisitorTemplate extends AbstractPrefixTreeFilter.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 for each call to, say a Filter.getDocIdSet(org.apache.lucene.index.LeafReaderContext, org.apache.lucene.util.Bits).
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
visit(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.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
hasIndexedLeaves |
acceptDocs, context, docsEnum, maxDoc, termsEnum| Constructor and Description |
|---|
AbstractVisitingPrefixTreeFilter.VisitorTemplate(LeafReaderContext context,
Bits acceptDocs,
boolean hasIndexedLeaves) |
| 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(AbstractVisitingPrefixTreeFilter.VNode vNode) |
protected void |
preSiblings(AbstractVisitingPrefixTreeFilter.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 boolean |
visit(Cell cell)
Visit an indexed cell returned from
findSubCellsToVisit(org.apache.lucene.spatial.prefix.tree.Cell). |
protected abstract void |
visitLeaf(Cell cell)
Called after visit() returns true and an indexed leaf cell is found.
|
protected abstract void |
visitScanned(Cell cell)
The cell is either indexed as a leaf or is the last level of detail.
|
collectDocspublic AbstractVisitingPrefixTreeFilter.VisitorTemplate(LeafReaderContext context, Bits acceptDocs, boolean hasIndexedLeaves) throws IOException
IOExceptionpublic DocIdSet getDocIdSet() throws IOException
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 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).IOExceptionprotected abstract void start()
throws IOException
IOExceptionprotected abstract DocIdSet finish() throws IOException
IOExceptionprotected abstract boolean visit(Cell cell) throws IOException
findSubCellsToVisit(org.apache.lucene.spatial.prefix.tree.Cell).cell - An intersecting cell.IOExceptionprotected abstract void visitLeaf(Cell cell) throws IOException
IOExceptionprotected abstract void visitScanned(Cell cell) throws IOException
IOExceptionprotected void preSiblings(AbstractVisitingPrefixTreeFilter.VNode vNode) throws IOException
IOExceptionprotected void postSiblings(AbstractVisitingPrefixTreeFilter.VNode vNode) throws IOException
IOExceptionCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.