How to wait for ES indexing to finish in Rspec and Capybara? How to wait for ES indexing to finish in Rspec and Capybara? elasticsearch elasticsearch

How to wait for ES indexing to finish in Rspec and Capybara?


Make a call to the 'refresh' API endpoint. If you're using Tire and the ActiveModel integration feature, it would be:

Question.tire.index.refresh

Alternatively you can use curl to hit the endpoint directly.


You can call refresh on the index and that will cause it to rebuild:

Question.index.refresh