# How I can limit suggest results to existing?

**URL:** https://discuss.elastic.co/t/how-i-can-limit-suggest-results-to-existing/13155
**Category:** Elasticsearch
**Created:** [August 9, 2013, 6:02pm UTC](https://discuss.elastic.co/t/how-i-can-limit-suggest-results-to-existing/13155 "2013-08-09T18:02:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Igor\_Ivanov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_ivanov/32/2170_2.png) [@Igor\_Ivanov](https://discuss.elastic.co/u/Igor_Ivanov)
#### Post date: [August 9, 2013, 6:02pm UTC](https://discuss.elastic.co/t/how-i-can-limit-suggest-results-to-existing/13155/1 "2013-08-09T18:02:53Z")

</div>

For some phrases suggest can return corrections not existing in the index.  
E.g. 'brokin steel' will suggest 'broken steel', but this combination is  
not in the index, so search will produce no results.  
Is there any way to limit suggestions only to those that would return  
results?

My sample query:  
"suggest": {  
"text": "brokin steel",  
"simple\_phrase": {  
"phrase": {  
"field": "name",  
"size": 1,  
"real\_word\_error\_likelihood": 0.95,  
"max\_errors": 2,  
"direct\_generator": [  
{  
"field": "name",  
"suggest\_mode": "missing",  
"min\_word\_len": 3  
}  
]  
}  
}  
}

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)
#### Post date: [August 11, 2013, 7:20am UTC](https://discuss.elastic.co/t/how-i-can-limit-suggest-results-to-existing/13155/2 "2013-08-11T07:20:13Z")

</div>

Can you try raising the confidence factor a bit to something like 2 or so?  
([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/phrase-suggest/))  
I think it would make sense to add such a feature that will make sure that  
the combination of terms exists in at least a single document.. Can you  
open an issue?

simon

On Friday, August 9, 2013 8:02:53 PM UTC+2, Igor Ivanov wrote:

> For some phrases suggest can return corrections not existing in the index.  
> E.g. 'brokin steel' will suggest 'broken steel', but this combination is  
> not in the index, so search will produce no results.  
> Is there any way to limit suggestions only to those that would return  
> results?
> 
> My sample query:  
> "suggest": {  
> "text": "brokin steel",  
> "simple\_phrase": {  
> "phrase": {  
> "field": "name",  
> "size": 1,  
> "real\_word\_error\_likelihood": 0.95,  
> "max\_errors": 2,  
> "direct\_generator": [  
> {  
> "field": "name",  
> "suggest\_mode": "missing",  
> "min\_word\_len": 3  
> }  
> ]  
> }  
> }  
> }

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Amit\_Soni](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Amit\_Soni](https://discuss.elastic.co/u/Amit_Soni)
#### Post date: [September 8, 2013, 8:21am UTC](https://discuss.elastic.co/t/how-i-can-limit-suggest-results-to-existing/13155/3 "2013-09-08T08:21:29Z")

</div>

Hi Simon and Igor - Just wanted to check whether an issue was opened for  
this request?

-Amit.

On Sun, Aug 11, 2013 at 12:20 AM, simonw  
[simon.willnauer@elasticsearch.com](mailto:simon.willnauer@elasticsearch.com)wrote:

> Can you try raising the confidence factor a bit to something like 2 or so?  
> ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/phrase-suggest/))  
> I think it would make sense to add such a feature that will make sure that  
> the combination of terms exists in at least a single document.. Can you  
> open an issue?
> 
> simon
> 
> On Friday, August 9, 2013 8:02:53 PM UTC+2, Igor Ivanov wrote:
> 
> > For some phrases suggest can return corrections not existing in the index.  
> > E.g. 'brokin steel' will suggest 'broken steel', but this combination is  
> > not in the index, so search will produce no results.  
> > Is there any way to limit suggestions only to those that would return  
> > results?
> > 
> > My sample query:  
> > "suggest": {  
> > "text": "brokin steel",  
> > "simple\_phrase": {  
> > "phrase": {  
> > "field": "name",  
> > "size": 1,  
> > "real\_word\_error\_likelihood": 0.95,  
> > "max\_errors": 2,  
> > "direct\_generator": [  
> > {  
> > "field": "name",  
> > "suggest\_mode": "missing",  
> > "min\_word\_len": 3  
> > }  
> > ]  
> > }  
> > }  
> > }
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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: [September 8, 2013, 10:48am UTC](https://discuss.elastic.co/t/how-i-can-limit-suggest-results-to-existing/13155/4 "2013-09-08T10:48:36Z")

</div>

I can't point it out now (on phone) but I'm pretty sure there is on. I've spent a few hours hacking on it at least. I should have _something_ in the next few days.

Sent from my iPhone

On Sep 8, 2013, at 4:21 AM, Amit Soni [amitsoni29@gmail.com](mailto:amitsoni29@gmail.com) wrote:

> Hi Simon and Igor - Just wanted to check whether an issue was opened for this request?
> 
> -Amit.
> 
> On Sun, Aug 11, 2013 at 12:20 AM, simonw [simon.willnauer@elasticsearch.com](mailto:simon.willnauer@elasticsearch.com) wrote:
> 
> > Can you try raising the confidence factor a bit to something like 2 or so? ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/phrase-suggest/))  
> > I think it would make sense to add such a feature that will make sure that the combination of terms exists in at least a single document.. Can you open an issue?
> > 
> > simon
> > 
> > On Friday, August 9, 2013 8:02:53 PM UTC+2, Igor Ivanov wrote:
> > 
> > > For some phrases suggest can return corrections not existing in the index.  
> > > E.g. 'brokin steel' will suggest 'broken steel', but this combination is not in the index, so search will produce no results.  
> > > Is there any way to limit suggestions only to those that would return results?
> > > 
> > > My sample query:  
> > > "suggest": {  
> > > "text": "brokin steel",  
> > > "simple\_phrase": {  
> > > "phrase": {  
> > > "field": "name",  
> > > "size": 1,  
> > > "real\_word\_error\_likelihood": 0.95,  
> > > "max\_errors": 2,  
> > > "direct\_generator": [  
> > > {  
> > > "field": "name",  
> > > "suggest\_mode": "missing",  
> > > "min\_word\_len": 3  
> > > }  
> > > ]  
> > > }  
> > > }  
> > > }
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:17am UTC](https://discuss.elastic.co/t/how-i-can-limit-suggest-results-to-existing/13155/5 "2017-07-06T02:17:35Z")

</div>


