Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get the ElasticSearch `refresh_interval` for an index?

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?

like image 371
km1 Avatar asked Aug 01 '18 15:08

km1


People also ask

How do I get Elasticsearch data?

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 .

What is the refresh rate in Elasticsearch?

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.


1 Answers

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.

like image 192
Val Avatar answered Nov 15 '22 05:11

Val