Bool Filteredit

See Bool Filter

FilterBuilders.boolFilter()
    .must(FilterBuilders.termFilter("tag", "wow"))
    .mustNot(FilterBuilders.rangeFilter("age").from("10").to("20"))
    .should(FilterBuilders.termFilter("tag", "sometag"))
    .should(FilterBuilders.termFilter("tag", "sometagtag"));

Note that you can cache the result using BoolFilterBuilder#cache(boolean) method. See Caching.