elasticsearch/elasticsearch — pull request #5597 by markharwood (2014-03-28 16:47:08+00:00)
Title: Freq terms enum

Based on the work started in https://github.com/elasticsearch/elasticsearch/pull/5489
Two new utility classes to support analysis of term frequencies used by significant_terms agg and phrase suggester. The FilterableTermsEnum base class provides access to stats with an optional filter (this will be of use in examining significant_terms against a background other than the entire index).
The FreqTermsEnum subclass adds caching support for scenarios where there are likely to be repeated calls for the same term's counts.