Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class 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.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Inheritance
    object
    BaseTermsEnumTraverser
    VisitorTemplate
    Inherited Members
    BaseTermsEnumTraverser.m_filter
    BaseTermsEnumTraverser.m_context
    BaseTermsEnumTraverser.m_acceptDocs
    BaseTermsEnumTraverser.m_maxDoc
    BaseTermsEnumTraverser.m_termsEnum
    BaseTermsEnumTraverser.m_docsEnum
    BaseTermsEnumTraverser.CollectDocs(FixedBitSet)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Spatial.Prefix
    Assembly: Lucene.Net.Spatial.dll
    Syntax
    public abstract class VisitorTemplate : BaseTermsEnumTraverser

    Constructors

    VisitorTemplate(AbstractVisitingPrefixTreeFilter, AtomicReaderContext, IBits?, bool)

    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.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    protected VisitorTemplate(AbstractVisitingPrefixTreeFilter outerInstance, AtomicReaderContext context, IBits? acceptDocs, bool hasIndexedLeaves)
    Parameters
    Type Name Description
    AbstractVisitingPrefixTreeFilter outerInstance
    AtomicReaderContext context
    IBits acceptDocs
    bool hasIndexedLeaves

    Fields

    m_hasIndexedLeaves

    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.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    protected readonly bool m_hasIndexedLeaves
    Field Value
    Type Description
    bool

    Methods

    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>
    Exceptions
    Type Condition
    ArgumentNullException

    cell is null.

    Finish()

    Called last to return the result.

    Declaration
    protected abstract DocIdSet Finish()
    Returns
    Type Description
    DocIdSet
    Exceptions
    Type Condition
    IOException

    GetDocIdSet()

    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.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public virtual DocIdSet? GetDocIdSet()
    Returns
    Type Description
    DocIdSet

    PostSiblings(VNode)

    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.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    protected virtual void PostSiblings(VisitorTemplate.VNode vNode)
    Parameters
    Type Name Description
    VisitorTemplate.VNode vNode

    PreSiblings(VNode)

    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.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    protected virtual void PreSiblings(VisitorTemplate.VNode vNode)
    Parameters
    Type Name Description
    VisitorTemplate.VNode vNode

    Scan(int)

    Scans (termsEnum.MoveNext()) 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
    int scanDetailLevel
    Exceptions
    Type Condition
    IOException

    Start()

    Called first to setup things.

    Declaration
    protected abstract void Start()
    Exceptions
    Type Condition
    IOException

    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
    bool

    true to descend to more levels. It is an error to return true if cell.Level == detailLevel

    Exceptions
    Type Condition
    IOException

    VisitLeaf(Cell)

    Called after Visit(Cell) 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(Cell) 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.

    Exceptions
    Type Condition
    IOException

    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
    IOException
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.