I am using a match search for a city called Astoria
, and I am using a custom analyzer for cities. When I search for Astoria
, the analyzer will return Queens
. Queens is returning just fine. However, because it matches Queens
, it also returns cities like Queens Village
. Is there a way to change the query so that Queens Village doesnt return, ideally an option that wouldnt require reindexing all fields? And only the cities specified in the query or analyzer match? So it should match for all cities in the custom analyzer and Astoria
.
{
"bool": {
"must": [
{
"match": {
"full_name": {
"query": "Bob",
"analyzer": "nickname_analyzer",
}
}
},
{
"bool": {
"must": [
{
"match": {
"city": {
"query": "astoria",
"operator": "or",
"analyzer": "city_analyzer",
}
}
}
]
}
},
],
}
}