Skip to content

[FEATURE] Add overloads that takes multiple QueryDescriptors to Filter()/Must()/MustNot()/Should() of BoolQueryDescriptor #7508

Closed
@rlindber

Description

@rlindber

Is your feature request related to a problem? Please describe.
The current code using Nest is generating QueryDescriptor object, that are finally combined in a BoolQueryDescriptor with calls to Filter(), Must(), MustNot() or Should(). Example signature from Nest client:

public BoolQueryDescriptor<T> Must(params QueryContainer[] queries)

Describe the solution you'd like
The corresponding function for BoolQueryDescriptor in Elastic.Clients only takes one QueryDescriptor, instead of an array as in Nest. From Elastic.Clients:

public BoolQueryDescriptor<TDocument> Must(QueryDescriptor<TDocument> descriptor)

Could these four function be replaced with functions that take multiple QueryDescriptor objects, e.g. using "params", like this?

public BoolQueryDescriptor<TDocument> Must(params QueryDescriptor<TDocument>[] descriptors)

Describe alternatives you've considered
It would require a lot of work to rewrite the existing code to used a function that take multiple object, like

public BoolQueryDescriptor<TDocument> Must(params Action<QueryDescriptor<TDocument>>[] configure)

or

public BoolQueryDescriptor<TDocument> Must(ICollection<Query>? must)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions