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.
Implements
Inherited Members
Namespace: OpenSearch.Client
Assembly: OpenSearch.Client.dll
Syntax
public class FieldCollapse : IFieldCollapse
Properties
| Edit this page View SourceField
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 |
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 |
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? |