Indices Query Usage

edit

Fluent DSL example

edit
q
.Indices(c => c
    .Name("named_query")
    .Boost(1.1)
    .Indices(Index<Project>())
    .Query(qq => qq.MatchAll())
    .NoMatchQuery(qq => qq.MatchAll(m => m.Name("no_match")))
)

Object Initializer syntax example

edit
new IndicesQuery()
{
    Name = "named_query",
    Boost = 1.1,
    Indices = Index<Project>(),
    Query = new MatchAllQuery(),
    NoMatchQuery = new MatchAllQuery { Name = "no_match" }
}

Example json output.

{
  "indices": {
    "_name": "named_query",
    "boost": 1.1,
    "indices": [
      "project"
    ],
    "no_match_query": {
      "match_all": {
        "_name": "no_match"
      }
    },
    "query": {
      "match_all": {}
    }
  }
}