Constant Score Query Usageedit

Fluent DSL exampleedit

q
.ConstantScore(c => c
    .Name("named_query")
    .Boost(1.1)
    .Filter(qq => qq.MatchAll(m => m.Name("filter")))
)

Object Initializer syntax exampleedit

new ConstantScoreQuery()
{
    Name = "named_query",
    Boost = 1.1,
    Filter = new MatchAllQuery { Name = "filter" },
}

Example json output.

{
  "constant_score": {
    "_name": "named_query",
    "boost": 1.1,
    "filter": {
      "match_all": {
        "_name": "filter"
      }
    }
  }
}