for (String tf : termFacets) {
builder.addFacet(FacetBuilders.termsFacet(tf).field(tf));
}
XContentFilterBuilder fb = null;
for (Entry<String, Object> e : filters.entrySet()) {
XContentFilterBuilder tmp = FilterBuilders.termFilter(e.getKey(), e.getValue());
if (fb != null)
fb = FilterBuilders.andFilter(fb, tmp);
else
fb = tmp;
}