I add a document to my index (by using Java High Level Client). The insert request suceeds. But if immediately search for the newly indexed document the search request's response does not include the new document. The search request is guaranteed to happend after the insert request - but maybe only delayed by a few milliseconds.
My index is configured to have one shard and one replica. Though, Elasticsearch is running on a single node and therefore there should be no replica (cluster status is yellow).
At what point in the indexing worklflow does Elasticsearch responds with 'succeeded' to the requestor? Could this happen before the document is actually indexed?
From what I understand Elasticsearch should response when the new document is added to every (active) node (primary or replica).
Which scenario could cause my concurrency issue?
If your insert request was successful, your document was indexed, but it is not immediately available for search.
You need to wait the refresh of the index, which per default happens every second and is managed by the setting index.refresh_interval