Refresh interval related query

I am newbie in elastic search so this may sound trivial but i want to know more about the refresh_interval as it seems to affect vertex retrieval in ES.

Interpretation 1:
refresh_interval is set to 1s(Default settings).
Does this mean that newly inserted data will be available for search after 1s of committing the mutation OR if the index refresh will begin after 1s of commit?

Interpretation 2:
When inserting a large set of vertices, say 10k vertices in a graph database with ES.
After what time, the first inserted vertex would become available?

  1. 1s after the insertion of the first vertex
  2. 1s after the insertion of the last vertex
  3. Reindexing will begin after 1s when insertion of all vertices is complete.
  4. Reindexing is included within commit operation
    (Right now, i am able to fetch data as soon as i fetch and refresh_interval of 1s seems to have no affect here but it fails if refresh_interval is increased to 5s)

Questions:
1.What is relation between refresh_interval and reindexing process?
2. What can be done with refresh_interval to ensure that the data is retrieved successfully after insertion, allowing for delays(if any)?

when _refresh is called all documents added to elasticsearch prior to the refresh call are made visible such that subsequent searches to a refreshed shards will retrieve these document given they match a query. refresh_interval will just call _refresh every second in the background.

1.What is relation between refresh_interval and reindexing process?

there is no different to index or reindex, the same principle applies

  1. What can be done with refresh_interval to ensure that the data is retrieved successfully after insertion, allowing for delays(if any)?

you can use the ?refresh=wait_for option on the indexing side to ensure docs are visible once the indexing request returns see ?refresh | Elasticsearch Guide [6.4] | Elastic

Hi

Thanks for clearing.

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