srb = filteredSearchRequest(query, filter, IndexHelper.determineAffectedIndices(indexRangeService, deflector, range));
}
TermsStatsFacetBuilder stats = new TermsStatsFacetBuilder(TERMS_STATS_FACET_NAME);
stats.global(false);
stats.keyField(keyField);
stats.valueField(valueField);
stats.order(TermsStatsFacet.ComparatorType.fromString(order.toString().toLowerCase()));
stats.size(size);
stats.facetFilter(standardFilters(range, filter));