# Phrase suggester not delivering any results

**URL:** <https://discuss.elastic.co/t/phrase-suggester-not-delivering-any-results/18048>\
**Category:** Elasticsearch\
**Created:** [June 11, 2014, 2:31pm UTC](https://discuss.elastic.co/t/phrase-suggester-not-delivering-any-results/18048 "2014-06-11T14:31:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klaus\_Stadler](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@Klaus\_Stadler](https://discuss.elastic.co/u/Klaus_Stadler)\
**Post date:** [June 11, 2014, 2:31pm UTC](https://discuss.elastic.co/t/phrase-suggester-not-delivering-any-results/18048/1 "2014-06-11T14:31:15Z")

</div>

I've been trying to get the phrase suggester up and running, but something  
is wrong. I don't get any results.

The search query looks like this:  
{  
"suggest": {  
"text": "schoko",  
"simple\_phrase": {  
"phrase": {  
"analyzer": "simple",  
"field": "title",  
"size": 4,  
"real\_word\_error\_likelihood": 0.95,  
"confidence": 2,  
"gram\_size": 1,  
"direct\_generator": [  
{  
"field": "title",  
"suggest\_mode": "always",  
"min\_word\_len": 1  
}  
]  
}  
}  
}  
}

The type mapping looks like this:  
{  
"products": {  
"properties": {  
"message": {  
"type": "string"  
},  
"image": {  
"type": "string"  
},  
"price": {  
"type": "string"  
},  
"source": {  
"type": "string"  
},  
"title": {  
"type": "multi\_field",  
"fields": {  
"title": {  
"type": "string"  
},  
"suggest": {  
"type": "string",  
"analyzer": "shingle\_analyzer",  
"store": true,  
"term\_vector": "with\_positions\_offsets"  
}  
}  
},  
"@timestamp": {  
"type": "date",  
"format": "dateOptionalTime"  
},  
"@version": {  
"type": "string"  
},  
"deeplink": {  
"type": "string"  
},  
"host": {  
"type": "string"  
},  
"logstash\_checksum": {  
"type": "string"  
},  
"path": {  
"type": "string"  
}  
}  
}  
}

And index settings look like this:  
{  
"settings": {  
"analysis": {  
"filter": {  
"shingle\_filter": {  
"type": "shingle",  
"min\_shingle\_size": 2,  
"max\_shingle\_size": 5  
}  
},  
"analyzer": {  
"shingle\_analyzer": {  
"type": "custom",  
"tokenizer": "standard",  
"filter": [  
"lowercase",  
"shingle\_filter"  
]  
}  
}  
}  
}  
}

Any ideas on what's wrong?  
I'd be really grateful for any hints!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ede1d487-11e8-4267-8c56-37cf82e10335%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ede1d487-11e8-4267-8c56-37cf82e10335%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Klaus\_Stadler](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@Klaus\_Stadler](https://discuss.elastic.co/u/Klaus_Stadler)\
**Post date:** [June 23, 2014, 1:55pm UTC](https://discuss.elastic.co/t/phrase-suggester-not-delivering-any-results/18048/2 "2014-06-23T13:55:33Z")

</div>

I've now tried to setup a Play Gist showing the problems:  
[https://www.found.no/play/gist/3fd142f32eb42cb0730d](https://www.found.no/play/gist/3fd142f32eb42cb0730d)  
When I search for "schwar" I get the suggestion "schwarz" as expected.

However, if I search for "iP" I don't get any suggestions.  
I'd want ES to suggest "iPad" and "iPhone" in this case.

How can this be achieved?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [June 23, 2014, 2:07pm UTC](https://discuss.elastic.co/t/phrase-suggester-not-delivering-any-results/18048/3 "2014-06-23T14:07:49Z")

</div>

Try setting  
max\_term\_freq to .99, prefix\_length to 1, and confidence to 0. See what  
that gives you.

Nik

On Mon, Jun 23, 2014 at 9:55 AM, Klaus Stadler \<  
[klaus.stadler@united-internet-media.de](mailto:klaus.stadler@united-internet-media.de)\> wrote:

> I've now tried to setup a Play Gist showing the problems:  
> [https://www.found.no/play/gist/3fd142f32eb42cb0730d](https://www.found.no/play/gist/3fd142f32eb42cb0730d)  
> When I search for "schwar" I get the suggestion "schwarz" as expected.
> 
> However, if I search for "iP" I don't get any suggestions.  
> I'd want ES to suggest "iPad" and "iPhone" in this case.
> 
> How can this be achieved?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2ffrwwt0h14Cko%2BtO3KGjYLjYMUCvA5OTA44\_tepnOjw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2ffrwwt0h14Cko%2BtO3KGjYLjYMUCvA5OTA44_tepnOjw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Klaus\_Stadler](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@Klaus\_Stadler](https://discuss.elastic.co/u/Klaus_Stadler)\
**Post date:** [June 23, 2014, 2:16pm UTC](https://discuss.elastic.co/t/phrase-suggester-not-delivering-any-results/18048/4 "2014-06-23T14:16:49Z")

</div>

Thanks for your suggestion. I've tried it immediately, but the only  
suggestion I get is "ip".

Am Montag, 23. Juni 2014 16:08:20 UTC+2 schrieb Nikolas Everett:

> Try setting  
> max\_term\_freq to .99, prefix\_length to 1, and confidence to 0. See what  
> that gives you.
> 
> Nik
> 
> On Mon, Jun 23, 2014 at 9:55 AM, Klaus Stadler \<  
> [klaus....@united-internet-media.de](mailto:klaus....@united-internet-media.de) \<javascript:\>\> wrote:
> 
> > I've now tried to setup a Play Gist showing the problems:  
> > [https://www.found.no/play/gist/3fd142f32eb42cb0730d](https://www.found.no/play/gist/3fd142f32eb42cb0730d)  
> > When I search for "schwar" I get the suggestion "schwarz" as expected.
> > 
> > However, if I search for "iP" I don't get any suggestions.  
> > I'd want ES to suggest "iPad" and "iPhone" in this case.
> > 
> > How can this be achieved?
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2a82c214-7720-4026-90a1-b263d6ec5b7c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2a82c214-7720-4026-90a1-b263d6ec5b7c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [June 23, 2014, 2:19pm UTC](https://discuss.elastic.co/t/phrase-suggester-not-delivering-any-results/18048/5 "2014-06-23T14:19:10Z")

</div>

Huh. Sorry, I'm not sure beyond that.

Nik

On Mon, Jun 23, 2014 at 10:16 AM, Klaus Stadler \<  
[klaus.stadler@united-internet-media.de](mailto:klaus.stadler@united-internet-media.de)\> wrote:

> Thanks for your suggestion. I've tried it immediately, but the only  
> suggestion I get is "ip".
> 
> Am Montag, 23. Juni 2014 16:08:20 UTC+2 schrieb Nikolas Everett:
> 
> > Try setting  
> > max\_term\_freq to .99, prefix\_length to 1, and confidence to 0. See what  
> > that gives you.
> > 
> > Nik
> > 
> > On Mon, Jun 23, 2014 at 9:55 AM, Klaus Stadler \<klaus....@united-  
> > [internet-media.de](http://internet-media.de)\> wrote:
> > 
> > > I've now tried to setup a Play Gist showing the problems:  
> > > [https://www.found.no/play/gist/3fd142f32eb42cb0730d](https://www.found.no/play/gist/3fd142f32eb42cb0730d)  
> > > When I search for "schwar" I get the suggestion "schwarz" as expected.
> > > 
> > > However, if I search for "iP" I don't get any suggestions.  
> > > I'd want ES to suggest "iPad" and "iPhone" in this case.
> > > 
> > > How can this be achieved?
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/2a82c214-7720-4026-90a1-b263d6ec5b7c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2a82c214-7720-4026-90a1-b263d6ec5b7c%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/2a82c214-7720-4026-90a1-b263d6ec5b7c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2a82c214-7720-4026-90a1-b263d6ec5b7c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1ZVAZuua3Hwu5xoJ2C\_v7%3DA47222yFapYeAhX1pk7Lsw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1ZVAZuua3Hwu5xoJ2C_v7%3DA47222yFapYeAhX1pk7Lsw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Klaus\_Stadler](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@Klaus\_Stadler](https://discuss.elastic.co/u/Klaus_Stadler)\
**Post date:** [June 23, 2014, 3:03pm UTC](https://discuss.elastic.co/t/phrase-suggester-not-delivering-any-results/18048/6 "2014-06-23T15:03:27Z")

</div>

I've experimented with a method suggested by a website:  
query:  
prefix:  
title.title\_shingle:  
value: ip  
facets:  
suggestion:  
terms:  
field: title.title\_shingle  
regex: ^ip.\*  
size: 10

The result looks good, but the website also mentions the performance isn't  
good with big indexes.

So I'm still looking for an alternative.

Am Montag, 23. Juni 2014 16:19:37 UTC+2 schrieb Nikolas Everett:

> Huh. Sorry, I'm not sure beyond that.
> 
> Nik
> 
> On Mon, Jun 23, 2014 at 10:16 AM, Klaus Stadler \<  
> [klaus....@united-internet-media.de](mailto:klaus....@united-internet-media.de) \<javascript:\>\> wrote:
> 
> > Thanks for your suggestion. I've tried it immediately, but the only  
> > suggestion I get is "ip".
> > 
> > Am Montag, 23. Juni 2014 16:08:20 UTC+2 schrieb Nikolas Everett:
> > 
> > > Try setting  
> > > max\_term\_freq to .99, prefix\_length to 1, and confidence to 0. See what  
> > > that gives you.
> > > 
> > > Nik
> > > 
> > > On Mon, Jun 23, 2014 at 9:55 AM, Klaus Stadler \<klaus....@united-  
> > > [internet-media.de](http://internet-media.de)\> wrote:
> > > 
> > > > I've now tried to setup a Play Gist showing the problems:  
> > > > [https://www.found.no/play/gist/3fd142f32eb42cb0730d](https://www.found.no/play/gist/3fd142f32eb42cb0730d)  
> > > > When I search for "schwar" I get the suggestion "schwarz" as expected.
> > > > 
> > > > However, if I search for "iP" I don't get any suggestions.  
> > > > I'd want ES to suggest "iPad" and "iPhone" in this case.
> > > > 
> > > > How can this be achieved?
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/80eee31c-a94b-47ce-973a-45718c9c7fdc%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .
> > > > 
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/2a82c214-7720-4026-90a1-b263d6ec5b7c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2a82c214-7720-4026-90a1-b263d6ec5b7c%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/2a82c214-7720-4026-90a1-b263d6ec5b7c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2a82c214-7720-4026-90a1-b263d6ec5b7c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bf9aef40-208b-4d94-85d7-f97dd7cdce71%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bf9aef40-208b-4d94-85d7-f97dd7cdce71%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 2017, 1:20am UTC](https://discuss.elastic.co/t/phrase-suggester-not-delivering-any-results/18048/7 "2017-07-06T01:20:31Z")

</div>


