Skip to content

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

Closed
@stevejgordon

Description

@stevejgordon

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"
            }
          }
        }
      ]
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions