Hi We wanted to suppot both partial search and exact match for one filed category.
Here is the mapping for category , We achieved this with fields.raw
"category": {
"properties": {
"name": {
"type": "string",
"analyzer": "autocomplete",
"search_analyzer": "standard",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
Everything is working as expected , I am able to do both exact and partial search. But When I am having char comma "," in the data , Exact match is not working. I am searching with category.name.raw, which is not_analyzed filed
{ "query": {
"filtered": {
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "",
"type": "cross_fields",
"fields": [
"filed1",
"field2^12"
]
}
},
{
"match": {
"category.name.raw": " Poverty, Poor and Hunger"
}
}
]
}
}
}}}
I am not getting any results, I am not sure what I am doing wrong, Please help me to fix this. Thanks in advance
string
is deprecated in latest versions.a – user156327