Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 929
Techie J Avatar asked Feb 24 '17 21:02

Techie J


1 Answers

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"
        }
      }
    }
  }
}
like image 50
Rahul Singhai Avatar answered Nov 15 '22 07:11

Rahul Singhai