I'm creating a little wrapper around the elasticsearch java api and found something weird. In my code I have the following sequence of execution:
2.Create index and index some data with bulk request
3.And finally get count of records:
The problem is that the count always shows 0 records. To make it working I have to add Thread.Sleep between inserting/indexing data and getting count. I thought that get executes when operation is completed. Is it normally behaviour here? Should I wait a little more to give time to indexing data before execute count?