Phrase suggester not working term suggester is working

Is there a setting which governs if one is disabled?

I have an ES deployment where phrase suggester does not suggest anything while term suggester does.

This does not give any suggestions-

GET index_name/type/_search
{
"size":0,
"suggest": {
"text": { "projec",
"simple_phrase": {
"phrase": {
"field": "name"
}
}
}
}
}

Changing "phrase" to "term" starts working and gives the suggestion

GET index_name/type/_search
{
"size":0,
"suggest": {
"text": { "projec",
"simple_phrase": {
"term": {
"field": "name"
}
}
}
}
}

I want to use phrase suggester so I can filter the suggestions on the basis of collate query I run. So I cannot work with term suggester.

Thanks to @ishim for pointing me to the missing "confidence" param because of which suggestions were not coming.

The query should have correct confidence value to return the suggestions- (read more here)

GET index_name/type/_search
{
"size":0,
"suggest": {
"text": { "projec",
"simple_phrase": {
"phrase": {
"field": "name",
"confidence":0
}
}
}
}
}

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