ES 5.2 refresh_interval doesn't work if set to 0

Hello,

I used following API to set index refresh_interval to zero [yes, I want to refresh an index immediately ]

PUT localhost:9200/indexname/_settings
{
"index" : {
"refresh_interval" :"0"
}
}

GET localhost:9200/indexname/_settings

  • result
    {
    "indexname": {
    "settings": {
    "index": {
    "refresh_interval": "0",
    "number_of_shards": "5",
    "provided_name": "indexname",
    "creation_date": "1489749844952",
    "number_of_replicas": "1",
    "uuid": "TKovyYpwRdeqsA__Qj0Pww",
    "version": {
    "created": "5020199"
    }
    }
    }
    }
    }

BUT IF I INSERT ANY NEW DOCUMENT, IT DOESN'T REFLECT AT ALL.

I don't believe it can be set to 0. FWIW I believe that 0 means no refresh here.

But please even if this would be possible, never ever do such a thing.

Elasticsearch is not designed to provide real time search.
Going close to 0 is going to cost you a lot.

But why do you need this in the first place?

1 Like

Hi @dadoonet,

We need this only during development, default refresh_interval is 1s, which takes time if we have to verify during development.

So we want to set it for an immediate refresh once insert or update the document.

Call refresh API in your tests https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-refresh.html

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.