Caching

edit

By default, some filters are cached or not cached. You can have a fine tuning control using cache(boolean) method when exists. For example:

FilterBuilder filter = FilterBuilders.andFilter(
        FilterBuilders.rangeFilter("postDate").from("2010-03-01").to("2010-04-01"),
        FilterBuilders.prefixFilter("name.second", "ba")
        )
    .cache(true);