Show / Hide Table of Contents

    Class AbstractFirstPassGroupingCollector<TGroupValue>

    FirstPassGroupingCollector is the first of two passes necessary to collect grouped hits. This pass gathers the top N sorted groups. Concrete subclasses define what a group is and how it is internally collected.

    See org.apache.lucene.search.grouping for more details including a full code example.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    AbstractFirstPassGroupingCollector<TGroupValue>
    FunctionFirstPassGroupingCollector
    TermFirstPassGroupingCollector
    Implements
    IAbstractFirstPassGroupingCollector<TGroupValue>
    ICollector
    Namespace: Lucene.Net.Search.Grouping
    Assembly: Lucene.Net.Grouping.dll
    Syntax
    public abstract class AbstractFirstPassGroupingCollector<TGroupValue> : object, IAbstractFirstPassGroupingCollector<TGroupValue>, ICollector
    Type Parameters
    Name Description
    TGroupValue

    Constructors

    | Improve this Doc View Source

    AbstractFirstPassGroupingCollector(Sort, Int32)

    Create the first pass collector.

    Declaration
    public AbstractFirstPassGroupingCollector(Sort groupSort, int topNGroups)
    Parameters
    Type Name Description
    Sort groupSort

    The Sort used to sort the groups. The top sorted document within each group according to groupSort, determines how that group sorts against other groups. This must be non-null, ie, if you want to groupSort by relevance use Sort.RELEVANCE.

    System.Int32 topNGroups

    How many top groups to keep.

    Fields

    | Improve this Doc View Source

    m_orderedGroups

    Declaration
    protected SortedSet<CollectedSearchGroup<TGroupValue>> m_orderedGroups
    Field Value
    Type Description
    SortedSet<CollectedSearchGroup<TGroupValue>>

    Properties

    | Improve this Doc View Source

    AcceptsDocsOutOfOrder

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

    Methods

    | Improve this Doc View Source

    Collect(Int32)

    Declaration
    public virtual void Collect(int doc)
    Parameters
    Type Name Description
    System.Int32 doc
    | Improve this Doc View Source

    CopyDocGroupValue(TGroupValue, TGroupValue)

    Returns a copy of the specified group value by creating a new instance and copying the value from the specified groupValue in the new instance. Or optionally the reuse argument can be used to copy the group value in.

    Declaration
    protected abstract TGroupValue CopyDocGroupValue(TGroupValue groupValue, TGroupValue reuse)
    Parameters
    Type Name Description
    TGroupValue groupValue

    The group value to copy

    TGroupValue reuse

    Optionally a reuse instance to prevent a new instance creation

    Returns
    Type Description
    TGroupValue

    a copy of the specified group value

    | Improve this Doc View Source

    GetDocGroupValue(Int32)

    Returns the group value for the specified doc.

    Declaration
    protected abstract TGroupValue GetDocGroupValue(int doc)
    Parameters
    Type Name Description
    System.Int32 doc

    The specified doc

    Returns
    Type Description
    TGroupValue

    the group value for the specified doc

    | Improve this Doc View Source

    GetTopGroups(Int32, Boolean)

    Returns top groups, starting from offset. This may return null, if no groups were collected, or if the number of unique groups collected is <= offset.

    Declaration
    public virtual IEnumerable<ISearchGroup<TGroupValue>> GetTopGroups(int groupOffset, bool fillFields)
    Parameters
    Type Name Description
    System.Int32 groupOffset

    The offset in the collected groups

    System.Boolean fillFields

    Whether to fill to SortValues

    Returns
    Type Description
    IEnumerable<ISearchGroup<TGroupValue>>

    top groups, starting from offset

    | Improve this Doc View Source

    SetNextReader(AtomicReaderContext)

    Declaration
    public virtual void SetNextReader(AtomicReaderContext context)
    Parameters
    Type Name Description
    AtomicReaderContext context
    | Improve this Doc View Source

    SetScorer(Scorer)

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

    Implements

    IAbstractFirstPassGroupingCollector<TGroupValue>
    ICollector
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)