I'm using elastic4s client that returns a Future
in response to index request and when that future completes I still have to do Thread.sleep(1000)
before I can query for that indexed record. Mostly it is exactly 1 second. Is there an elasticsearch setting that I can change so that when the Future completes the record will be available?
I tried to use the java client directly client.prepareIndex....execute().actionGet();
and it ends up exactly the same way, I have to call Thread.sleep(1000)
Is there any settings I can change for the record to be ready after the future completes?
execute(index into(foo, bar) id uuid fields baz).await
Thread.sleep(1000) // This is mandatory for search to find it
execute {search in foo}.await // returns empty without Thread.sleep(1000)