if (facets == null)
return ret;
for (Facet facet : facets.facets()) {
if (facet instanceof TermsFacet) {
TermsFacet ff = (TermsFacet) facet;
Integer integ = filterToIndex.get(ff.getName());
if (integ != null && ff.entries() != null) {
List<FacetHelper> list = new ArrayList<FacetHelper>();
String key = ff.getName();
for (TermsFacet.Entry e : ff.entries()) {
String term = e.getTerm();
if ("T".equals(term))
term = "true";
else if ("F".equals(term))
term = "false";
// exclude smaller zero?
list.add(new FacetHelper(key, term,
translate(key + ":" + term), e.getCount()));
}
ret.set(integ, new MapEntry(ff.getName(), list));
}
} else if (facet instanceof FilterFacet) {
FilterFacet ff = (FilterFacet) facet;
String name = ff.getName();
int firstIndex = name.indexOf(":");
if (firstIndex < 0)
continue;
String key = name.substring(0, firstIndex);
if (DATE.equals(key))
continue;
String val = name.substring(firstIndex + 1);
// exclude smaller zero?
Long count = ff.count();
if (count == null)
count = 0L;
Integer index = filterToIndex.get(key);
if (index == null)