asdwert
asdwert

Reputation: 21

How to manually trigger refresh for Elastic search index?

In some of the articles I found the following, to optimizing performance for bulk indexing.

It can even make sense to temporarily turn off refreshing completely for an index (by setting the interval to -1), e.g., during a bulk indexing run, and trigger it manually at the end. reference

How do we manually trigger it? Does searching on index manually trigger it because I am able to search on the index just after it i created, didn't run any refresh api.

Upvotes: 2

Views: 6200

Answers (1)

Val
Val

Reputation: 217564

In order to trigger the refresh manually, you simply need to hit the _refresh endpoint on an index

POST your-index/_refresh

Searching on an index doesn't trigger the refresh automatically. Refreshes occur at recurring intervals, as specified by the index.refresh_interval index setting. If it's set to -1, then no refresh happens and you need to trigger it manually if you want fresh data.

Upvotes: 5

Related Questions