title: How to deal with elasticsearch delay when doing unit test?
body: <p>There're some delay in elasticsearch from requesting to index a document to the document become searchable. I want to know how to deal with this in a unit test, for example, first index a document, then check if it is really indexed. Now I simply use a Thread.sleep() call to delay some time(I'm using a plain junit class), say 2 second. Is this OK? Or there're better solutions?</p>