# Explain API for Phrase Suggester

**URL:** <https://discuss.elastic.co/t/explain-api-for-phrase-suggester/306619>\
**Category:** Elasticsearch\
**Created:** [June 8, 2022, 3:31am UTC](https://discuss.elastic.co/t/explain-api-for-phrase-suggester/306619 "2022-06-08T03:31:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KR09](https://avatars.discourse-cdn.com/v4/letter/k/b2d939/32.png) [@KR09](https://discuss.elastic.co/u/KR09)\
**Post date:** [June 8, 2022, 3:31am UTC](https://discuss.elastic.co/t/explain-api-for-phrase-suggester/306619/1 "2022-06-08T03:31:10Z")

</div>

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:

```auto
"options":[
   {
    "text": "source",
     "score":0.0094098
  } ,
  {
    "text": "secure",
    "score":0.0071755894
  }
]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2022, 3:31am UTC](https://discuss.elastic.co/t/explain-api-for-phrase-suggester/306619/2 "2022-07-06T03:31:39Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
