Limit Query Usageedit

A limit query limits the number of documents (per shard) to execute on.

Deprecated in 2.0.0-beta1. Use the terminate_after parameter on the request instead.

See the Elasticsearch documentation on limit query for more details.

Fluent DSL exampleedit

q
.Limit(c => c
    .Name("named_query")
    .Boost(1.1)
    .Limit(100)
)

Object Initializer syntax exampleedit

new LimitQuery
{
    Name = "named_query",
    Boost = 1.1,
    Limit = 100
}

Example json output.

{
  "limit": {
    "_name": "named_query",
    "boost": 1.1,
    "limit": 100
  }
}