if (allTerms) {
try {
for (IndexReader reader : context.searcher().subReaders()) {
ShortFieldData fieldData = (ShortFieldData) fieldDataCache.cache(fieldDataType, reader, indexFieldName);
fieldData.forEachValue(aggregator);
}
} catch (Exception e) {
throw new FacetPhaseExecutionException(facetName, "failed to load all terms", e);
}
}