IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Bool Filter
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Bool Filter
editSee Bool Filter
FilterBuilder filter = boolFilter()
.must(termFilter("tag", "wow"))
.mustNot(rangeFilter("age").from("10").to("20"))
.should(termFilter("tag", "sometag"))
.should(termFilter("tag", "sometagtag"));
Note that you can cache the result using
BoolFilterBuilder#cache(boolean) method. See Caching.