I have a list of cities like this:
["New York","Bayern Munchen","Porto Alegre"]
I want to search some query in must or should section and use this cities keywords in filter section, but this cities have white space and elastic search does not response.
{
"query":{
"bool":{
"should":[
{
"match_phrase":{
"title":"pizza"
}
},
{
"match_phrase":{
"content":"foods"
}
}
],
"filter":[
{
"range":{
"date":{
"gte":"2015-01-01"
}
}
},
{
"terms":{
"cities":[
"New York",
"Bayern Munchen",
"Porto Alegre"
]
}
}
],
"minimum_should_match":1
}
}
}
this code use "terms" in filter, but the result is empty. How can i use this keywords in filter section?