TermsFacet.ComparatorType comparatorType = (TermsFacet.ComparatorType) getFieldValue( InternalStringTermsFacet.class, "comparatorType", facet );
//New Instance of the wrapper for the String Facet
internalFacet = new InternalWrapperStringTermsFacet( facet.getName(), comparatorType, requiredSize, facet.getEntries(), facet.getMissingCount(), facet.getTotalCount() );
} else if ( internalFacet instanceof InternalCountDateHistogramFacet ) {
InternalCountDateHistogramFacet facet = (InternalCountDateHistogramFacet) internalFacet;
//Getting private fields values required for the proper build of the wrapper
DateHistogramFacet.ComparatorType comparatorType = (DateHistogramFacet.ComparatorType) getFieldValue( InternalCountDateHistogramFacet.class, "comparatorType", facet );
//New Instance of the wrapper for the Date Facet
internalFacet = new InternalWrapperCountDateHistogramFacet( facet.getName(), comparatorType, facet.getEntries() );
}
internalFacets.put( key, internalFacet );
}