Is refresh needed when creating new type, template...and what refresh really means?

Hi there,

(not so?) Noob question:

We had a discussion with a colleague about when refresh is needed. And particularly, is it needed when creating templates, new type and so on...

Hopefully, the best answer will certainly come from the community :slight_smile:

The documentation of refresh , to me, means that refresh (admin().indices().prepareRefresh(..).get()) is needed when indexing new document (or deleting...) so that the data modifications is immediately available everywhere on the cluster. Right.

But what about modifications regarding index settings, template creation matching an index, new type...

My colleague has the feeling that whenever you do such modifications, you need to call refresh so that the modif is immediately available to other nodes of the cluster. I don't.

Typically, if I create a new type A (with some custom mappings) on node 1 and immediately index a document of that new type on another node 2 of the cluster, if refresh has not been called on the index (whether automatically through refresh interval or programmatically by the developer), will the new type be immediately available on node 2 with my custom mapping?

Said differently, any settings/mapping/template/type modification done on one node of the cluster, is immediately available to other nodes of the cluster. Refresh is useless for this purpose and is only used for indexed data availability, not for machinery ?

Right? Wrong? Other behaviour? Thx for clarifications.