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
11 stars 1.15k forks source link

[FEATURE] Support bool query operators in Query DSL for fluent (descriptor) syntax #7594

Open stevejgordon opened 1 year ago

stevejgordon commented 1 year ago

This is broken out from #6556.

Add support for combining queries created using the fluent syntax into bool queries using the &&, ||, ! and + operators.

For example:

var search = new SearchRequestDescriptor<Project>()
    .Query(q => q
            .Term(p => p.Name, "x") || q
            .Term(p => p.Name, "y"));

should produce:

{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "name": {
              "value": "x"
            }
          }
        },
        {
          "term": {
            "name": {
              "value": "y"
            }
          }
        }
      ]
    }
  }
}
b93rn commented 1 year ago

I'm missing this as well, basically every operator on this page.

btcpbordeaux commented 9 months ago

Any update on this? This is preventing migration from ES 7.17 / Nest client. Is there a rough timeline on when to expect this in the client? Thanks!