Class AbstractVisitingPrefixTreeFilter.VisitorTemplate
An abstract class designed to make it easy to implement predicates or
other operations on a SpatialPrefixTree indexed field. An instance
of this class is not designed to be re-used across AtomicReaderContext
instances so simply create a new one for each call to, say a
Lucene.Net.Search.Filter.GetDocIdSet(Lucene.Net.Index.AtomicReaderContext, Lucene.Net.Util.IBits).
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
Lucene.Net.Util.FixedBitSet. Then it starts the traversal
process, calling FindSubCellsToVisit(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(Cell) is called. At
some depths, of the tree, the algorithm switches to a scanning mode that
calls VisitScanned(Cell)
for each leaf cell found.
This is a Lucene.NET INTERNAL API, use at your own risk
Inheritance
System.Object
AbstractVisitingPrefixTreeFilter.VisitorTemplate
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Lucene.Net.Spatial.dll
Syntax
public abstract class VisitorTemplate : AbstractPrefixTreeFilter.BaseTermsEnumTraverser
Constructors
|
Improve this Doc
View Source
VisitorTemplate(AbstractVisitingPrefixTreeFilter, AtomicReaderContext, IBits, Boolean)
Declaration
public VisitorTemplate(AbstractVisitingPrefixTreeFilter outerInstance, AtomicReaderContext context, IBits acceptDocs, bool hasIndexedLeaves)
Parameters
Type |
Name |
Description |
AbstractVisitingPrefixTreeFilter |
outerInstance |
|
Lucene.Net.Index.AtomicReaderContext |
context |
|
Lucene.Net.Util.IBits |
acceptDocs |
|
System.Boolean |
hasIndexedLeaves |
|
Fields
|
Improve this Doc
View Source
m_hasIndexedLeaves
Declaration
protected readonly bool m_hasIndexedLeaves
Field Value
Type |
Description |
System.Boolean |
|
Methods
|
Improve this Doc
View Source
FindSubCellsToVisit(Cell)
Called when doing a divide & conquer to find the next intersecting cells
of the query shape that are beneath cell
. cell
is
guaranteed to have an intersection and thus this must return some number
of nodes.
Declaration
protected virtual IEnumerator<Cell> FindSubCellsToVisit(Cell cell)
Parameters
Type |
Name |
Description |
Cell |
cell |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerator<Cell> |
|
|
Improve this Doc
View Source
Finish()
Called last to return the result.
Declaration
protected abstract DocIdSet Finish()
Returns
Type |
Description |
Lucene.Net.Search.DocIdSet |
|
Exceptions
Type |
Condition |
System.IO.IOException |
|
|
Improve this Doc
View Source
GetDocIdSet()
Declaration
public virtual DocIdSet GetDocIdSet()
Returns
Type |
Description |
Lucene.Net.Search.DocIdSet |
|
|
Improve this Doc
View Source
PostSiblings(AbstractVisitingPrefixTreeFilter.VNode)
Declaration
protected virtual void PostSiblings(AbstractVisitingPrefixTreeFilter.VNode vNode)
Parameters
|
Improve this Doc
View Source
PreSiblings(AbstractVisitingPrefixTreeFilter.VNode)
Declaration
protected virtual void PreSiblings(AbstractVisitingPrefixTreeFilter.VNode vNode)
Parameters
|
Improve this Doc
View Source
Scan(Int32)
Scans (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(Cell).
Declaration
protected virtual void Scan(int scanDetailLevel)
Parameters
Type |
Name |
Description |
System.Int32 |
scanDetailLevel |
|
Exceptions
Type |
Condition |
System.IO.IOException |
|
|
Improve this Doc
View Source
Start()
Called first to setup things.
Declaration
protected abstract void Start()
Exceptions
Type |
Condition |
System.IO.IOException |
|
|
Improve this Doc
View Source
Visit(Cell)
Declaration
protected abstract bool Visit(Cell cell)
Parameters
Type |
Name |
Description |
Cell |
cell |
An intersecting cell.
|
Returns
Type |
Description |
System.Boolean |
true to descend to more levels. It is an error to return true
if cell.Level == detailLevel
|
Exceptions
Type |
Condition |
System.IO.IOException |
|
|
Improve this Doc
View Source
VisitLeaf(Cell)
Called after visit() returns true and an indexed leaf cell is found.
Declaration
protected abstract void VisitLeaf(Cell cell)
Parameters
Type |
Name |
Description |
Cell |
cell |
|
Exceptions
Type |
Condition |
System.IO.IOException |
|
|
Improve this Doc
View Source
VisitScanned(Cell)
The cell is either indexed as a leaf or is the last level of detail. It
might not even intersect the query shape, so be sure to check for that.
Declaration
protected abstract void VisitScanned(Cell cell)
Parameters
Type |
Name |
Description |
Cell |
cell |
|
Exceptions
Type |
Condition |
System.IO.IOException |
|