Search Results for

    Show / Hide Table of Contents

    Class FieldCollapse

    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
    FieldCollapse
    Implements
    IFieldCollapse
    Inherited Members
    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 FieldCollapse : IFieldCollapse

    Properties

    | Edit this page View Source

    Field

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

    Declaration
    public Field Field { get; set; }
    Property Value
    Type Description
    Field
    | Edit this page View Source

    InnerHits

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

    Declaration
    public IInnerHits InnerHits { get; set; }
    Property Value
    Type Description
    IInnerHits
    | Edit this page View Source

    MaxConcurrentGroupSearches

    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 int? MaxConcurrentGroupSearches { get; set; }
    Property Value
    Type Description
    int?

    Implements

    IFieldCollapse

    Extension Methods

    SuffixExtensions.Suffix(object, string)
    • Edit this page
    • View Source
    In this article
    • Properties
      • Field
      • InnerHits
      • MaxConcurrentGroupSearches
    • Implements
    • Extension Methods
    Back to top Generated by DocFX