I wish to improve search in an ES index by searching for greek letter synonyms (α as alpha). In this post they use a 'regular' analyzer that would require to re-index all of the data.
My question is how to accomplish this synonym search using a search_analyzer only.
Thanks!
Here is an example of two entries and a search query, I would like this single query to return both docs
PUT test_ind/_doc/2
{
"title" : "α"
}
PUT test_ind/_doc/1
{
"title" : "alpha"
}
POST test_ind/_search
{
"query": {
"term": {
"title": "alpha"
}}
}
expected output:
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 2,
"max_score" : 1.0,
"hits" : [
{
"_index" : "test_ind",
"_type" : "_doc",
"_id" : "2",
"_score" : 1.0,
"_source" : {
"title" : "alpha"
}
},
{
"_index" : "test_ind",
"_type" : "_doc",
"_id" : "1",
"_score" : 1.0,
"_source" : {
"title" : "α"
}
}
]
}
}