Hi All,
We are using Phrase Suggester to implement "Did you mean" functionality. We have added direct_generator to control min_word_length,collate to only return the suggestion based on the documents present in the index .
I ran in to a scenario where user searched for "Seucre" and was expecting Elasticsearch would suggest the corrected keyword as "secure" because edit distance is one for transposed letters but instead it suggested "source" .I checked the list of suggestions returned ,in this case "source" is ranked high when compared to "secure' .
Both "secure" and "source" are present in the index. Why is "source" ranked higher? I used the explain API but it did not provide any additional details. Do we have any API like explain for Phrase suggester. Any information on how the Phrase suggester assigns score will be helpful. Thanks in advance.
Output:
"options":[
{
"text": "source",
"score":0.0094098
} ,
{
"text": "secure",
"score":0.0071755894
}
]