Use Elasticsearch provided assertions.

Instead of digging out the number of hits use Elasticsearch provided helper
method to check the hit count. (Thanks @spinscale for the suggestion)

In addition simplify the test slightly by factoring index setup into
separate method executed before test execution.

Relates to #4879