elasticsearch/elasticsearch — pull request #7960 by markharwood (2014-10-02 13:25:14+00:00)
Title: Aggs fix - significant terms can throw error on index with deleted docs.

If an index contains a highly popular term and many deleted documents it can cause an error as reported in issue #7951

The background count for docs should include deleted docs otherwise a term’s docFreq (which includes deleted docs) can exceed the number of docs reported in the index and cause an exception.

The randomisation that deletes documents is also removed from tests as this doc-accounting change would mean the specific scores being expected in tests would now be subject to random variability and so fail.

Closes #7951