Raw Combine Usage

edit

NEST’s raw query can be combined with other queries using a compound query such as a bool query.

Fluent DSL example

edit
q.Raw(RawTermQuery) && q.Term("x", "y")

Object Initializer syntax example

edit
new RawQuery(RawTermQuery)
&& new TermQuery { Field = "x", Value = "y" }

Example json output.

{
  "bool": {
    "must": [
      {
        "term": {
          "fieldname": "value"
        }
      },
      {
        "term": {
          "x": {
            "value": "y"
          }
        }
      }
    ]
  }
}