After reading some Elasticsearch index tuning guides like How to Maximize Elasticsearch Index Performance and elastic's Tune for indexing speed I wanted to take a look at updating the refresh_interval.
We are using AWS Elasticsearch domains (elasticsearch version 6.2). There's no mention of refresh_interval on Cloudformation's doc site AWS::Elasticsearch::Domain
So I wanted to see what the default setting was for AWS Elasticsearch. Using the _settings API doesn't show the refresh_interval.
GET /my_index/_settings
And specifying the refresh_interval doesn't show anything either.
GET /my_index/_settings/index.refresh_interval
Only returns an empty object.
{}
How can I find the current refresh_interval for Elasticsearch?
You can use the search API to search and aggregate data stored in Elasticsearch data streams or indices. The API's query request body parameter accepts queries written in Query DSL. The following request searches my-index-000001 using a match query. This query matches documents with a user.id value of kimchy .
By default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds. You can change this default interval using the index. refresh_interval setting.
You need to add a parameter called include_defaults
in order to also retrieve the default values:
GET /my_index/_settings?include_defaults=true
In the response, you'll get a defaults
section which includes the default value of the refresh_interval
setting, most probably 1s
.
NOTE: The reason the refresh_interval
is empty is because your index has not set the value explicitly and so your index uses the default value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With