elasticsearch/elasticsearch — pull request #2115 by awick (2012-07-24 20:55:55+00:00)
Title: Handle facet terms int overflow better

Facet terms are int based and can overflow with a large number of documents.
Instead of overflowing return Integer.MAX_VALUE.
This fix assumes overflow only happens during the reduce phase.