I have used search query for phonetic search. But, now first I want to get suggestion before searching.
I tried using same analyzer which I used for phonetic searching, but, got messy result.
Here is an example
GET new_us/_search
{
"suggest": {
"my_suggest": {
"text" : "google",
"term" : {
"field" : "mark_identification.phonetic_suggest"
}
}
}
}
Result:
{
"took": 90,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 0,
"max_score": 0,
"hits": []
},
"suggest": {
"my_suggest": [
{
"text": "gugil",
"offset": 0,
"length": 6,
"options": []
},
{
"text": "gugl",
"offset": 0,
"length": 6,
"options": []
},
{
"text": "guglY",
"offset": 0,
"length": 6,
"options": []
},
{
"text": "gugli",
"offset": 0,
"length": 6,
"options": []
}
]
}
}
These are for "gugly" not for "gugal"(pronunciation).