Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class TermFirstPassGroupingCollector

    Concrete implementation of AbstractFirstPassGroupingCollector<TGroupValue> that groups based on field values and more specifically uses Lucene.Net.Index.SortedDocValues to collect groups.

    Note

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

    Inheritance
    object
    AbstractFirstPassGroupingCollector<BytesRef>
    TermFirstPassGroupingCollector
    Implements
    IAbstractFirstPassGroupingCollector<BytesRef>
    ICollector
    Inherited Members
    AbstractFirstPassGroupingCollector<BytesRef>.m_orderedGroups
    AbstractFirstPassGroupingCollector<BytesRef>.GetTopGroups(int, bool)
    AbstractFirstPassGroupingCollector<BytesRef>.SetScorer(Scorer)
    AbstractFirstPassGroupingCollector<BytesRef>.Collect(int)
    AbstractFirstPassGroupingCollector<BytesRef>.AcceptsDocsOutOfOrder
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Search.Grouping.Terms
    Assembly: Lucene.Net.Grouping.dll
    Syntax
    public class TermFirstPassGroupingCollector : AbstractFirstPassGroupingCollector<BytesRef>, IAbstractFirstPassGroupingCollector<BytesRef>, ICollector

    Constructors

    TermFirstPassGroupingCollector(string, Sort, int)

    Create the first pass collector.

    Declaration
    public TermFirstPassGroupingCollector(string groupField, Sort groupSort, int topNGroups)
    Parameters
    Type Name Description
    string groupField

    The field used to group documents. This field must be single-valued and indexed (Lucene.Net.Search.FieldCache is used to access its value per-document).

    Sort groupSort

    The Lucene.Net.Search.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 Lucene.Net.Search.Sort.RELEVANCE.

    int topNGroups

    How many top groups to keep.

    Exceptions
    Type Condition
    IOException

    When I/O related errors occur

    Methods

    CopyDocGroupValue(BytesRef, BytesRef)

    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 override BytesRef CopyDocGroupValue(BytesRef groupValue, BytesRef reuse)
    Parameters
    Type Name Description
    BytesRef groupValue

    The group value to copy

    BytesRef reuse

    Optionally a reuse instance to prevent a new instance creation

    Returns
    Type Description
    BytesRef

    a copy of the specified group value

    Overrides
    AbstractFirstPassGroupingCollector<BytesRef>.CopyDocGroupValue(BytesRef, BytesRef)

    GetDocGroupValue(int)

    Returns the group value for the specified doc.

    Declaration
    protected override BytesRef GetDocGroupValue(int doc)
    Parameters
    Type Name Description
    int doc

    The specified doc

    Returns
    Type Description
    BytesRef

    the group value for the specified doc

    Overrides
    AbstractFirstPassGroupingCollector<BytesRef>.GetDocGroupValue(int)

    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 override void SetNextReader(AtomicReaderContext context)
    Parameters
    Type Name Description
    AtomicReaderContext context

    next atomic reader context

    Overrides
    AbstractFirstPassGroupingCollector<BytesRef>.SetNextReader(AtomicReaderContext)

    Implements

    IAbstractFirstPassGroupingCollector<TGroupValue>
    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.