Search Results for

    Show / Hide Table of Contents

    Class FieldCollapseDescriptor<T>

    Allows to collapse search results based on field values. The collapsing is done by selecting only the top sorted document per collapse key. For instance the query below retrieves the best tweet for each user and sorts them by number of likes.

    NOTE: The collapsing is applied to the top hits only and does not affect aggregations.

    Inheritance
    object
    DescriptorBase<FieldCollapseDescriptor<T>, IFieldCollapse>
    FieldCollapseDescriptor<T>
    Implements
    IDescriptor
    IFieldCollapse
    Inherited Members
    DescriptorBase<FieldCollapseDescriptor<T>, IFieldCollapse>.Self
    DescriptorBase<FieldCollapseDescriptor<T>, IFieldCollapse>.Assign<TValue>(TValue, Action<IFieldCollapse, TValue>)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: OpenSearch.Client
    Assembly: OpenSearch.Client.dll
    Syntax
    public class FieldCollapseDescriptor<T> : DescriptorBase<FieldCollapseDescriptor<T>, IFieldCollapse>, IDescriptor, IFieldCollapse where T : class
    Type Parameters
    Name Description
    T

    Methods

    | Edit this page View Source

    Field(Field)

    The field used for collapsing must be a single valued keyword or number field with doc-values activated

    Declaration
    public FieldCollapseDescriptor<T> Field(Field field)
    Parameters
    Type Name Description
    Field field
    Returns
    Type Description
    FieldCollapseDescriptor<T>
    | Edit this page View Source

    Field<TValue>(Expression<Func<T, TValue>>)

    The field used for collapsing must be a single valued keyword or number field with doc-values activated

    Declaration
    public FieldCollapseDescriptor<T> Field<TValue>(Expression<Func<T, TValue>> objectPath)
    Parameters
    Type Name Description
    Expression<Func<T, TValue>> objectPath
    Returns
    Type Description
    FieldCollapseDescriptor<T>
    Type Parameters
    Name Description
    TValue
    | Edit this page View Source

    InnerHits(Func<InnerHitsDescriptor<T>, IInnerHits>)

    It is also possible to expand each collapsed top hits with the inner_hits option.

    Declaration
    public FieldCollapseDescriptor<T> InnerHits(Func<InnerHitsDescriptor<T>, IInnerHits> selector = null)
    Parameters
    Type Name Description
    Func<InnerHitsDescriptor<T>, IInnerHits> selector
    Returns
    Type Description
    FieldCollapseDescriptor<T>
    | Edit this page View Source

    MaxConcurrentGroupSearches(int?)

    The expansion of the group is done by sending an additional query for each inner_hit request for each collapsed hit returned in the response. This can significantly slow things down if you have too many groups and/or inner_hit requests. The max_concurrent_group_searches request parameter can be used to control the maximum number of concurrent searches allowed in this phase. The default is based on the number of data nodes and the default search thread pool size.

    Declaration
    public FieldCollapseDescriptor<T> MaxConcurrentGroupSearches(int? maxConcurrentGroupSearches)
    Parameters
    Type Name Description
    int? maxConcurrentGroupSearches
    Returns
    Type Description
    FieldCollapseDescriptor<T>

    Implements

    IDescriptor
    IFieldCollapse

    Extension Methods

    SuffixExtensions.Suffix(object, string)
    • Edit this page
    • View Source
    In this article
    • Methods
      • Field(Field)
      • Field<TValue>(Expression<Func<T, TValue>>)
      • InnerHits(Func<InnerHitsDescriptor<T>, IInnerHits>)
      • MaxConcurrentGroupSearches(int?)
    • Implements
    • Extension Methods
    Back to top Generated by DocFX