Show / Hide Table of Contents

    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 GetDocIdSet(AtomicReaderContext, 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 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
    AbstractPrefixTreeFilter.BaseTermsEnumTraverser
    AbstractVisitingPrefixTreeFilter.VisitorTemplate
    Inherited Members
    AbstractPrefixTreeFilter.BaseTermsEnumTraverser.m_outerInstance
    AbstractPrefixTreeFilter.BaseTermsEnumTraverser.m_context
    AbstractPrefixTreeFilter.BaseTermsEnumTraverser.m_acceptDocs
    AbstractPrefixTreeFilter.BaseTermsEnumTraverser.m_maxDoc
    AbstractPrefixTreeFilter.BaseTermsEnumTraverser.m_termsEnum
    AbstractPrefixTreeFilter.BaseTermsEnumTraverser.m_docsEnum
    AbstractPrefixTreeFilter.BaseTermsEnumTraverser.CollectDocs(FixedBitSet)
    Namespace: Lucene.Net.Spatial.Prefix
    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
    AtomicReaderContext context
    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
    IEnumerator<Cell>
    | Improve this Doc View Source

    Finish()

    Called last to return the result.

    Declaration
    protected abstract DocIdSet Finish()
    Returns
    Type Description
    DocIdSet
    | Improve this Doc View Source

    GetDocIdSet()

    Declaration
    public virtual DocIdSet GetDocIdSet()
    Returns
    Type Description
    DocIdSet
    | Improve this Doc View Source

    PostSiblings(AbstractVisitingPrefixTreeFilter.VNode)

    Declaration
    protected virtual void PostSiblings(AbstractVisitingPrefixTreeFilter.VNode vNode)
    Parameters
    Type Name Description
    AbstractVisitingPrefixTreeFilter.VNode vNode
    | Improve this Doc View Source

    PreSiblings(AbstractVisitingPrefixTreeFilter.VNode)

    Declaration
    protected virtual void PreSiblings(AbstractVisitingPrefixTreeFilter.VNode vNode)
    Parameters
    Type Name Description
    AbstractVisitingPrefixTreeFilter.VNode vNode
    | 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
    | Improve this Doc View Source

    Start()

    Called first to setup things.

    Declaration
    protected abstract void Start()
    | Improve this Doc View Source

    Visit(Cell)

    Visit an indexed cell returned from FindSubCellsToVisit(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

    | 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
    Remarks

    Called after Visit() returns true and an indexed leaf cell is found. An indexed leaf cell means associated documents generally won't be found at further detail levels.

    | 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
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)