I have a simple query
GET data/_search
{
"query": {
"bool": {
"must": [
{
"prefix": {
"last_name": "test"
}
},
{
"bool": {
"should": {
"query_string": {
"query": "henderson OR Boulder City OR Sloan",
"fields": [
"city_*"
]
}
}
}
}
]
}
}
}
I would like to change the query_string to a filter. I'm not sure how to convert
{
"bool": {
"should": {
"query_string": {
"query": "henderson OR Boulder City OR Sloan",
"fields": [
"city_*"
]
}
}
}
}
into something like
"filter": {
"query_string": {
"query": "henderson OR Boulder City OR Sloan",
"fields": [
"city_*"
]
}
}
and make sure it filters by all this cities henderson OR Boulder City OR Sloan and by all this fields city_*.keyword
Any ideas?