title: Elasticsearch Doucment disappears for a few seconds
body: <p>After performing a <code>_bulk</code> operation to insert 50 documents, I run a search. I noticed that sometimes the search doesn't return all 50 documents. Sometimes somewhere between 1 and 3 documents will be missing. I have a polling mechanism that finds all 50, but it seems sometimes even after successful polling, the follow-up search query is short. But, given enough time (usually just an extra second or two), all 50 do become available.</p>
  <p>The documentation says that if you want to run a search immediately after an insert, you should use the <code>?refresh=wait_for</code> parameter, but my team really wants to avoid that as it would require a lot of re-testing and refactoring.</p>
  <p>As an alternative, I tried running a simple polling query to make sure all 50 documents got into the index, and then I notify the service that runs the complicated query that it can run its query now.</p>
  <p>However, even with the polling - sometimes the polling will be successful and find 50 documents, but the follow-up query will still have a few documents missing.
  I can even see this when I constantly run my query in ES Dev Tools after I do the bulk insert.
  I see the documents populate gradually - but right after I see 50 documents, the next query will be 48, and then right after it will be 50 again.</p>
  <p>So, all 50 get in at first (which is why my polling is successful), but it seems there is a short period where some documents will disappear from search, but then they reappear.</p>
  <p>Is this normal behavior? Is there anything I can do besides <code>?refresh=wait_for</code>?</p>