I am not aware of a way to set a query-specific timeout by using the Elasticsearch Query DSL. Also, that option doesn't seem dynamically updateable at all (I got a illegal_argument_exception
when I tried to update it by using the _cluster/settings
API).
Then, the only way I know to increase the period to wait for a response is by increasing the value of the timeout
setting in your elasticsearch.yml
configuration file.
However, I would suggest you (1) to check whether the resources (RAM, CPU) you assigned to your cluster are sufficient, and (2) to use some naming/lifecycle conventions for your snapshots, so that to add a more fine-grained way to filter them other than just by grouping snapshots by a repository name (e.g., naming convention <year>-<month>-<day_time>-snapshot
, then you could run narrow down your search e.g., GET _cat/snapshots/<myrepositoryname>/2020-January-*
).
PS. The wait_for_completion
query parameter is only blocking the request until a response from the server is received, but has nothing to do with the timeout.