WARNING: Version 5.x has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
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" } } } }