We are storing category in our index, here is the mapping for the category
"name": {
"type": "string",
"analyzer": "autocomplete",
"search_analyzer": "standard"
}
Now, we want to do an exact search for this field, here is the query that we are trying
{
"from": "0",
"size": "15",
"query": {
"filtered": {
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "a",
"type": "cross_fields",
"fields": [
"field1^20",
"filed1^12"
]
}
},
{
"match": {
"category.name": "Arts and Culture"
}
}
]
}
},
"filter": {
"bool": {
"must": [
{
"terms": {
"address_type": [
"val1",
"val2"
]
}
},
{
"terms": {
"status": ["Active","Inactive"]
}
}
]
}
}
}
}
}
But it is not matching exactly, I don't want to change the mapping as We want to do a partial search also in some other use case.
I just want to do exact match with some modification in the query, Is it possible or is there any workaround?
Thanks for the help.