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.
Bool Query Usageedit
Fluent DSL exampleedit
q .Bool(b => b .MustNot(m => m.MatchAll()) .Should(m => m.MatchAll()) .Must(m => m.MatchAll()) .Filter(f => f.MatchAll()) .MinimumShouldMatch(1) .Boost(2))
Object Initializer syntax exampleedit
new BoolQuery() { MustNot = new QueryContainer[] { new MatchAllQuery() }, Should = new QueryContainer[] { new MatchAllQuery() }, Must = new QueryContainer[] { new MatchAllQuery() }, Filter = new QueryContainer[] { new MatchAllQuery() }, MinimumShouldMatch = 1, Boost = 2 }
Example json output.
{ "bool": { "must": [ { "match_all": {} } ], "must_not": [ { "match_all": {} } ], "should": [ { "match_all": {} } ], "filter": [ { "match_all": {} } ], "minimum_should_match": 1, "boost": 2.0 } }