Techie J
Techie J

Reputation: 91

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

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.

Upvotes: 9

Views: 11116

Answers (1)

Rahul Singhai
Rahul Singhai

Reputation: 1339

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"
        }
      }
    }
  }
}

Upvotes: 21

Related Questions