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.
Terms List Query Usage
editTerms List Query Usage
editFluent DSL example
editq .Terms(c => c .Name("named_query") .Boost(1.1) .Field(p => p.Description) .DisableCoord() .MinimumShouldMatch(MinimumShouldMatch.Fixed(2)) .Terms(new List<string> { "term1", "term2" }) )
Object Initializer syntax example
editnew TermsQuery { Name = "named_query", Boost = 1.1, Field = "description", Terms = new List<string> { "term1", "term2" }, DisableCoord = true, MinimumShouldMatch = 2 }
Example json output.
{ "terms": { "_name": "named_query", "boost": 1.1, "description": [ "term1", "term2" ], "disable_coord": true, "minimum_should_match": 2 } }
Fluent DSL example
editq .Terms(c => c .Name("named_query") .Boost(1.1) .Field(p => p.Description) .DisableCoord() .Terms(_terms) )
Object Initializer syntax example
editnew TermsQuery { Name = "named_query", Boost = 1.1, Field = "description", Terms = _terms, DisableCoord = true, }
Example json output.
{ "terms": { "_name": "named_query", "boost": 1.1, "description": [ [ "term1", "term2" ] ], "disable_coord": true } }
Fluent DSL example
editq .Terms(c => c .Name("named_query") .Boost(1.1) .Field(p => p.NumberOfCommits) .DisableCoord() .Terms(_terms) )
Object Initializer syntax example
editnew TermsQuery { Name = "named_query", Boost = 1.1, Field = "numberOfCommits", Terms = _terms, DisableCoord = true, }
Example json output.
{ "terms": { "_name": "named_query", "boost": 1.1, "numberOfCommits": [ [ "term1", "term2" ] ], "disable_coord": true } }