Skip to content

FiltersAggregationDescriptor doesn't support descriptors to specify filters #7812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #8356
JuganD opened this issue Jul 11, 2023 · 2 comments · Fixed by #8485
Closed
Tracked by #8356

FiltersAggregationDescriptor doesn't support descriptors to specify filters #7812

JuganD opened this issue Jul 11, 2023 · 2 comments · Fixed by #8485
Labels

Comments

@JuganD
Copy link

JuganD commented Jul 11, 2023

Elastic.Clients.Elasticsearch version: 8.1.1

Elasticsearch version: 8.8.0

.NET runtime version: .NET 7

Operating system version: Windows 11

Description of the problem including expected versus actual behavior:
There is no overload of FiltersAggregationDescriptor<>.Filters() that supports descriptors.
I see this as a bug, because the entire codebase is successfully using descriptors from the point of connecting to the server to the point of getting a response, the entire flow is working with QueryDescriptor<>, but this class doesn't provide any way to utilize descriptors as filters.

My parameters are all coming in as descriptors and there is no way to provide them to the Filters method, as it only accepts Buckets<Query>.

Previously, using NEST, there was a Filter, instead of Filters method, which was utilized like this:
filterAggregation.Filter(f => firstQuery & secondQuery). Since there is no way of combining queries like this, as far as I'm aware, it should be able to work with multiple descriptors, ultimately achieving the same goal.

Steps to reproduce:

  1. Create new SearchRequestDescriptor<T>()
  2. Use the Aggregations method, which exposes an AggregationDescriptor<>
  3. Use Filters method, which exposes FiltersAggregationDescriptor<>
  4. There is no way to pass descriptors to FiltersAggregationDescriptor<>.Filters() method

Expected behavior
The class FiltersAggregationDescriptor should have an overload for the Filters method, which either accepts params Action<QueryDescriptor<TDocument>>[] configure or any kind of collection of descriptors, Buckets will also work as long as it accepts QueryDescriptor.

@JuganD JuganD added the 8.x Relates to a 8.x client version label Jul 11, 2023
@juvemar
Copy link

juvemar commented Nov 24, 2023

Are there some intentions of fixing this soon? Really needing it :/

@flobernd
Copy link
Member

Related to: Add fluent descriptor support for union types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants