I am using Elastic 5.1.2 version. I am using Elastic java Restclient for posting and query the documents from Elastic search.
I am not getting the accurate count of documents when i use GET operation immediately after the POST operation. If i sleep for > 1 sec between POST and GET, then the GET operation is able to give the accurate count.
My flow of operations are: 1) post a new transaction(document) using POST operation. 2) retrieve the count of total documents using GET operation. this is immediately after the POST.
I am thinking that, Elastic is taking time to update the index. Is this a problem with Elasticsearch or with any of my settings. Please help