Does BULK API returns results before task is completed?

I am using Elasticsearch-python bulk helpers to update a index and run a search query with a script. The query executes successfully only if add some timeout (say 10s) between bulk update and script. Is this because bulk update is async in nature or es-python function is async?

Documents indexed into Elasticsearch are are not immediately available for search. Making documents available for search is expensive and therefore only done periodically as per the refresh interval of the index.

Thank you so much! This was driving me crazy. What would be recommended way to handle this? How should determine what amount of time to wait before searching?

You can wait for refresh to occur (or even force one) in the bulk request . Be aware that forcing refreshes can have a significant impact on indexing performance.

1 Like

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