Make elasticsearch tests more robust

Rather than performing a search for a document, simply do a GET request,
which will always return a document which has been successfully
inserted, unlike searching for it, which only works after refreshing an
index.