Is _refresh the same as internal periodic refresh?

The documentation says that _refresh is resource-intensive.

But does calling _refresh on an index have the same impact and cost as the automatic periodic refresh that is configurable via index.refresh_interval? Is it perhaps even precisely the same operation internally?

If yes, that would mean that if index.refresh_interval is 1 s, it wouldn’t cause significant more load to call _refresh once every 10 - 20 s, right?

Hello @Mo_B ,

yes, the manuel refresh and the automatic periodic refresh (controlled by index.refresh_intervall) trigger the same internal operation in ES.

This operation involves Lucene making recent indexing operations visable to serach by creating a new searchable segment in memory by each shard.

It does indeed trigger the same operation. Triggering it every few seconds, either through the refresh interval or via API is fine. It is however as the ocs point out a resource intensive operation, so calling it after every indexing request, which some users try to do in order to get near real-time search availability, can quickly add a lot of overhead and cause performance problems.

1 Like