# Is it possible to make phrase suggester not return non-existent suggestions?

**URL:** https://discuss.elastic.co/t/is-it-possible-to-make-phrase-suggester-not-return-non-existent-suggestions/14209
**Category:** Elasticsearch
**Created:** [November 1, 2013, 12:41am UTC](https://discuss.elastic.co/t/is-it-possible-to-make-phrase-suggester-not-return-non-existent-suggestions/14209 "2013-11-01T00:41:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![roytmana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roytmana/32/44855_2.png) [@roytmana](https://discuss.elastic.co/u/roytmana)
#### Post date: [November 1, 2013, 12:41am UTC](https://discuss.elastic.co/t/is-it-possible-to-make-phrase-suggester-not-return-non-existent-suggestions/14209/1 "2013-11-01T00:41:41Z")

</div>

Hi,

I am experimenting with the phrase suggester and I can't figure out a way  
to make it not return word combinations that are not in the index?  
Using a shingled field for the suggester is not an option for the moment so  
it has to operate on the actual non shingled field

Also, is there any way suggestions could be restricted to a certain filter?  
I do not really want to return suggestions that will not pass my query's  
extra filter as using them will return no data

Thank you,  
Alex

--  
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: [November 4, 2013, 1:36pm UTC](https://discuss.elastic.co/t/is-it-possible-to-make-phrase-suggester-not-return-non-existent-suggestions/14209/2 "2013-11-04T13:36:05Z")

</div>

On Thu, Oct 31, 2013 at 8:41 PM, AlexR [roytmana@gmail.com](mailto:roytmana@gmail.com) wrote:

> Hi,
> 
> I am experimenting with the phrase suggester and I can't figure out a way  
> to make it not return word combinations that are not in the index?  
> Using a shingled field for the suggester is not an option for the moment  
> so it has to operate on the actual non shingled field

I don't believe it'll do you much good (beyond term suggester) without a  
shingled field.

> Also, is there any way suggestions could be restricted to a certain  
> filter? I do not really want to return suggestions that will not pass my  
> query's extra filter as using them will return no data

This is still open:

> <https://github.com/elastic/elasticsearch/issues/3482>
>
> When using phrase suggest API to provide "Did you mean ?" corrections it would b…e nice to include only suggestions that would return results.
> 
> So returned phrase must exist at least in one document in the index.

I took a crack at implementing it a few months ago but the solution had a  
number of problem so I didn't even send a pull request for it. I'll open  
the pull request with the note that the solution isn't correct so maybe  
that'll spur some more conversation.

> Thank you,  
> Alex
> 
> --  
> 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:09am UTC](https://discuss.elastic.co/t/is-it-possible-to-make-phrase-suggester-not-return-non-existent-suggestions/14209/3 "2017-07-06T02:09:02Z")

</div>


