Facet filters (not Filter Facet)

By default, facets are applied on the query resultset whatever filters exists or are.

If you need to compute facets with the same filters or even with other filters, you can add the filter to any facet using AbstractFacetBuilder#facetFilter(FilterBuilder) method:

    .termsFacet("f").field("brand") // Your facet
    .facetFilter( // Your filter here
        FilterBuilders.termFilter("colour", "pale")

For example, you can reuse the same filter you created for your query:

// A common filter
FilterBuilder filter = FilterBuilders.termFilter("colour", "pale");

TermsFacetBuilder facet = FacetBuilders.termsFacet("f")
    .facetFilter(filter);                           // We apply it to the facet

SearchResponse sr = node.client().prepareSearch()
    .setFilter(filter)                              // We apply it to the query

See documentation on how to build Filters.