NOTE: You are looking at documentation for an older release. For the latest information, see the current release documentation.
Constant Score Query Usage
editConstant Score Query Usage
editFluent DSL example
editq .ConstantScore(c => c .Name("named_query") .Boost(1.1) .Filter(qq => qq.MatchAll(m => m.Name("filter"))) )
Object Initializer syntax example
editnew 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" } } } }