Updated on 2024-11-29 GMT+08:00

Timeout Parameters

In scenarios where the demand for quick response is greater than that for the precision of query results, you can use the following parameters to improve the query performance:

  1. terminate_after: indicates the maximum number of documents collected for each shard. If the number is reached, the query request is terminated in advance.
  2. timeout: indicates the timeout duration for queries on each shard. Before the request times out, Elasticsearch returns the result obtained from each shard.

    For example, in security mode, run the following command:

    curl -XGET --tlsv1.2 --negotiate -k -u : "https://ip:httpport/_search?pretty&timeout=10ms&terminate_after=10"

    The terminate_after and timeout parameters may cause the query result to be incorrect. Exercise cautions when using them. Adjust parameter values as required.