How to check refresh interval in elastic search if it is not default
Asked Answered
B

1

9

I used command curl -XPOST 'localhost:9200/_refresh?pretty' to refresh ES.

I have read couple of posts where we can set refresh_interval to -1 to disable it, or the default refresh_interval is 1s. Also we can set it etc.

But what is command to check the refresh_interval which is not default.

Briquet answered 24/2, 2017 at 21:12 Comment(0)
D
21

You can check the settings of the index to get current value of refresh_interval:

curl -X GET 'localhost:9200/index_name/_settings'

NOTE: If refresh_interval is not manually set (set to default value of 1 second), it will not show any field named refresh_interval. If it is manually set to a value (either -1, or 1s, or any other value), it will show a field named refresh_interval with corresponding value:

{
  "index_name": {
    "settings": {
      "index": {
        "refresh_interval": "-1",
        "number_of_shards": "1",
        "provided_name": "index_name",
        "creation_date": "1532100398178",
        "number_of_replicas": "0",
        "uuid": "b-O02mUlS2aIZ-ahaEBvmQ",
        "version": {
          "created": "5060599"
        }
      }
    }
  }
}
Diggs answered 20/7, 2018 at 15:33 Comment(2)
Should I restart ElasticSearch after updating any of these settings?Consonantal
@bunjeeb, it is an index level setting. No server restart is required after changing refresh_interval setting value.Diggs

© 2022 - 2024 — McMap. All rights reserved.