elastic / elasticsearch-net

This strongly-typed, client library enables working with Elasticsearch. It is the official client maintained and supported by Elastic.
https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/index.html
Apache License 2.0
9 stars 1.15k forks source link

Logical operations between QueryDescriptor objects are not allowed #8002

Open bonny-bonev opened 10 months ago

bonny-bonev commented 10 months ago

Elastic.Clients.Elasticsearch version:8.11

Elasticsearch version:8.11

.NET runtime version:4.8

Operating system version:Win 11

Description of the problem including expected versus actual behavior: In previous versions (7.x) the QueryContainer objects could be used for logical operations like && and || example: QueryContainer container = container1 || container2;

In 8.x this is not working. The QueryContainer seems to be replaced with QueryDescriptor, which is fine, but the logical operations implementation is missing. Is this a bug, or something that will be added in the future, or is it replaced with some other approach?

Steps to reproduce:

  1. Try to construct a QueryDescriptor from two other queries with logical operations

Expected behavior The operation to be allowed, or documentation to be available on how to migrate such code.

Provide ConnectionSettings (if relevant):

Provide DebugInformation (if relevant):

### Tasks
bonny-bonev commented 10 months ago

Found a workaround to use Query object and not the facades. However it will be nice to port the functionality to the new 8.x API.

flobernd commented 10 months ago

Hi @bonny-bonev, some of the convenience features are not yet ported over from 7.x to 8.x. My primary focus is on endpoint support at the moment (there is still a lot of functionality missing in 8.x). Afterwards I definitely plan to bring back some of these usability imrovements.

niemyjski commented 1 month ago

And operators overloads*