Use elasticsearch#refresh instead of sleep

By default elasticsearch does not commit data to its index immediately.
Instead it is held in memory and periodically flushed to the index.

However it is possible to force the data to be in the index immediately
using a 'refresh' command[1,2].

This should resolve some of the intermittent test failures with elasticsearch.

[1] http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-refresh.html
[2] http://www.rubydoc.info/gems/elasticsearch-api/Elasticsearch/API/Indices/Actions#refresh-instance_method