Bool Filter - gnuhub/elasticsearch GitHub Wiki

A filter that matches documents matching boolean combinations of other queries. Similar in concept to Bool Query, except that the clauses are other filters.

{
    "filtered" : {
        "query" : {
            "queryString" : { 
                "default_field" : "message", 
                "query" : "elasticsearch"
            }
        },
        "filter" : {
            "bool" : {
                "must" : {
                    "term" : { "tag" : "wow" }
                },
                "must_not" : {
                    "range" : {
                        "age" : { "from" : 10, "to" : 20 }
                    }
                },
                "should" : [
                    {
                        "term" : { "tag" : "sometag" }
                    },
                    {
                        "term" : { "tag" : "sometagtag" }
                    }
                ]
            }
        }
    }
}    

Caching

The result of the bool filter is automatically cached by default. The _cache can be set to false to turn it off.

⚠️ **GitHub.com Fallback** ⚠️