Reputation: 6683
To optimize bulk insertions of a large amount of data into ElasticSearch indexes, I'm adding functionality to our driver to suspend index refreshes for a period of time. I've done this using admin indices update settings to set index.refresh_interval
to -1 and the back to 1 second. However, I can't seem to find a way to get index.refresh_interval
back from ElasticSearch, which means I can't get it to restore it later, can't do consistency checks against the index, and can't really test that what I've done has actually worked.
I've tried:
GET http://localhost:9200/[index_name]/_settings/
..but the result had only contained three settings, which seemed too few. Perhaps this REST call can take additional parameters to get more/different settings?
Upvotes: 0
Views: 385
Reputation: 6683
Found the solution before I posted the question, but as I'd already typed the question out, I thought I'd post it and the answer.
Basically, that GET
call against the _settings
endpoint in the question is what you need. However, if index.refresh_interval
hasn't been set on the index beforehand, either when created or through the _settings
endpoint, it doesn't appear in the list of settings returned. It seems like ElasticSearch doesn't hold a value for the setting for its default (which is 1 second, "1s").
I assume that ES only returns settings that don't have defaults or have been changed from their default, for brevity. It's a little confusing to begin with though, especially as the documentation for admin indices get settings is a bit... brief.
Upvotes: 1