Terms Query Usageedit

Filters documents that have fields that match any of the provided terms (not analyzed).

Be sure to read the Elasticsearch documentation on Terms query for more information.

Fluent DSL exampleedit

q
.Terms(c => c
    .Name("named_query")
    .Boost(1.1)
    .Field(p => p.Description)
    .Terms("term1", "term2")
)

Object Initializer syntax exampleedit

new TermsQuery
{
    Name = "named_query",
    Boost = 1.1,
    Field = "description",
    Terms = ExpectedTerms,
}

Example json output. 

{
  "terms": {
    "_name": "named_query",
    "boost": 1.1,
    "description": [
      "term1",
      "term2"
    ]
  }
}

Single term Terms Queryedit

Fluent DSL exampleedit

q
.Terms(c => c
    .Name("named_query")
    .Boost(1.1)
    .Field(p => p.Description)
    .Terms("term1")
)