ElasticSearch with multiple filters
The bool filter allows you to chain multiple MUST
, SHOULD
and SHOULD_NOT
requests together. Allowing for you to construct this into one query.
Here is how you can write multiple filter query
{
"query": {
"bool": {
"filter": [
{
"term" : {
"id":254
}
},
{
"term" : {
"cityId":35
}
}
],
"must": [
{
"match_all": {}
}
]
}
}
}