I have an index with synonyms :
"index": {
"analysis": {
"analyzer": {
"index_analyzer": {
"tokenizer": "standard",
"filter": [
"lowercase",
"my_stemmer"
]
},
"search_analyzer": {
"tokenizer": "standard",
"filter": [
"lowercase",
"synonym_filter",
"my_stemmer"
]
}
},
"filter": {
"synonym_filter": {
"type": "synonym_graph",
"synonyms_path": "/app/config/synonyms.txt",
"updateable": True
},
"my_stemmer": {
"type": "stemmer",
"language": "light_english"
}
}
}
}
with this mapping
"mappings": {
"properties": {
"title": {
"type": "text",
"analyzer": "index_analyzer",
"search_analyzer": "search_analyzer"
}
}
as you can see, I only use the synonyms filter in search-time.
now let's say I have a synonym like this:
nana, grammy => grandma
now when I search for nana
the search_analyzer replaces nana
with grandma
and only returns documents that contain the word grandma
and it completely ignores nana
.
Do you have any suggestions on what I should do? Should I add synonyms to index-time?