-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
8.xRelates to a 8.x client versionRelates to a 8.x client versionArea: ClientArea: GeneratorArea: SpecificationCategory: EnhancementUsability
Description
Currently it's only possible to use Anonymous Filters with the FiltersAggregation
:
var q = await client.SearchAsync<Person>(s => s
.Aggregations(aggs => aggs
.Add("my_agg", agg => agg
.Filters(a => a.Filters(new Buckets<Query>([
Query.MatchAll(new MatchAllQuery()),
Query.MatchAll(new MatchAllQuery())
])))
)
)
);
Using named filters throws an exception during deserialization of the results:
var q = await client.SearchAsync<Person>(s => s
.Aggregations(aggs => aggs
.Add("my_agg", agg => agg
.Filters(a => a.Filters(new Buckets<Query>(new Dictionary<string, Query> // <- Dictionary instead of Array
{
{ "a", Query.MatchAll(new MatchAllQuery()) },
{ "b", Query.MatchAll(new MatchAllQuery()) }
})))
)
)
);
To improve usability, we have to automatically set the keyed argument to true
, if the user requests named results.
Besides that, FiltersBucket
currently misses the key
field in the specification.
Related to #7844
sergey-tihon
Metadata
Metadata
Assignees
Labels
8.xRelates to a 8.x client versionRelates to a 8.x client versionArea: ClientArea: GeneratorArea: SpecificationCategory: EnhancementUsability