Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class AbstractGroupFacetCollector

    Base class for computing grouped facets.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    object
    AbstractGroupFacetCollector
    TermGroupFacetCollector
    Implements
    ICollector
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Search.Grouping
    Assembly: Lucene.Net.Grouping.dll
    Syntax
    public abstract class AbstractGroupFacetCollector : ICollector

    Constructors

    AbstractGroupFacetCollector(string, string, BytesRef)

    Base class for computing grouped facets.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    protected AbstractGroupFacetCollector(string groupField, string facetField, BytesRef facetPrefix)
    Parameters
    Type Name Description
    string groupField
    string facetField
    BytesRef facetPrefix

    Fields

    m_endFacetOrd

    Base class for computing grouped facets.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    protected int m_endFacetOrd
    Field Value
    Type Description
    int

    m_facetField

    Base class for computing grouped facets.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    protected readonly string m_facetField
    Field Value
    Type Description
    string

    m_facetPrefix

    Base class for computing grouped facets.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    protected readonly BytesRef m_facetPrefix
    Field Value
    Type Description
    BytesRef

    m_groupField

    Base class for computing grouped facets.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    protected readonly string m_groupField
    Field Value
    Type Description
    string

    m_segmentFacetCounts

    Base class for computing grouped facets.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    protected int[] m_segmentFacetCounts
    Field Value
    Type Description
    int[]

    m_segmentResults

    Base class for computing grouped facets.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    protected readonly IList<AbstractGroupFacetCollector.AbstractSegmentResult> m_segmentResults
    Field Value
    Type Description
    IList<AbstractGroupFacetCollector.AbstractSegmentResult>

    m_segmentTotalCount

    Base class for computing grouped facets.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    protected int m_segmentTotalCount
    Field Value
    Type Description
    int

    m_startFacetOrd

    Base class for computing grouped facets.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    protected int m_startFacetOrd
    Field Value
    Type Description
    int

    Properties

    AcceptsDocsOutOfOrder

    Return true if this collector does not require the matching docIDs to be delivered in int sort order (smallest to largest) to Collect(int).

    Most Lucene Query implementations will visit matching docIDs in order. However, some queries (currently limited to certain cases of Lucene.Net.Search.BooleanQuery) can achieve faster searching if the Lucene.Net.Search.ICollector allows them to deliver the docIDs out of order.

    Many collectors don't mind getting docIDs out of order, so it's important to return true here.

    Declaration
    public virtual bool AcceptsDocsOutOfOrder { get; }
    Property Value
    Type Description
    bool

    Methods

    Collect(int)

    Called once for every document matching a query, with the unbased document number.

    Note: The collection of the current segment can be terminated by throwing a Lucene.Net.Search.CollectionTerminatedException. In this case, the last docs of the current Lucene.Net.Index.AtomicReaderContext will be skipped and Lucene.Net.Search.IndexSearcher will swallow the exception and continue collection with the next leaf.

    Note: this is called in an inner search loop. For good search performance, implementations of this method should not call Doc(int) or Document(int) on every hit. Doing so can slow searches by an order of magnitude or more.
    Declaration
    public abstract void Collect(int doc)
    Parameters
    Type Name Description
    int doc

    CreateSegmentResult()

    Base class for computing grouped facets.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    protected abstract AbstractGroupFacetCollector.AbstractSegmentResult CreateSegmentResult()
    Returns
    Type Description
    AbstractGroupFacetCollector.AbstractSegmentResult

    MergeSegmentResults(int, int, bool)

    Returns grouped facet results that were computed over zero or more segments. Grouped facet counts are merged from zero or more segment results.

    Declaration
    public virtual AbstractGroupFacetCollector.GroupedFacetResult MergeSegmentResults(int size, int minCount, bool orderByCount)
    Parameters
    Type Name Description
    int size

    The total number of facets to include. This is typically offset + limit

    int minCount

    The minimum count a facet entry should have to be included in the grouped facet result

    bool orderByCount

    Whether to sort the facet entries by facet entry count. If false then the facets are sorted lexicographically in ascending order.

    Returns
    Type Description
    AbstractGroupFacetCollector.GroupedFacetResult

    grouped facet results

    Exceptions
    Type Condition
    IOException

    If I/O related errors occur during merging segment grouped facet counts.

    SetNextReader(AtomicReaderContext)

    Called before collecting from each Lucene.Net.Index.AtomicReaderContext. All doc ids in Collect(int) will correspond to Lucene.Net.Index.IndexReaderContext.Reader.

    Add Lucene.Net.Index.AtomicReaderContext.DocBase to the current Lucene.Net.Index.IndexReaderContext.Reader's internal document id to re-base ids in Collect(int).
    Declaration
    public abstract void SetNextReader(AtomicReaderContext context)
    Parameters
    Type Name Description
    AtomicReaderContext context

    next atomic reader context

    SetScorer(Scorer)

    Called before successive calls to Collect(int). Implementations that need the score of the current document (passed-in to Collect(int)), should save the passed-in Lucene.Net.Search.Scorer and call scorer.GetScore() when needed.

    Declaration
    public virtual void SetScorer(Scorer scorer)
    Parameters
    Type Name Description
    Scorer scorer

    Implements

    Lucene.Net.Search.ICollector
    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.