# Can PhraseSuggester search distant words?

**URL:** <https://discuss.elastic.co/t/can-phrasesuggester-search-distant-words/13942>\
**Category:** Elasticsearch\
**Created:** [October 14, 2013, 2:23pm UTC](https://discuss.elastic.co/t/can-phrasesuggester-search-distant-words/13942 "2013-10-14T14:23:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barak\_Yaish](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@Barak\_Yaish](https://discuss.elastic.co/u/Barak_Yaish)\
**Post date:** [October 14, 2013, 2:23pm UTC](https://discuss.elastic.co/t/can-phrasesuggester-search-distant-words/13942/1 "2013-10-14T14:23:11Z")

</div>

Hi,

Say I've the following text: "A keyboard and a mouse went to a bar", and  
the user search for "keyboard mouse". Can the PhraseSuggester locate that  
text? I know I can use the completion suggester and index the document with  
multiple inputs, but then I have to figure out all the permutations of the  
words in the text. I was wonder whether PhraseSuggester may be used for  
that purpose, but some tests I ran failed to find the text. Is it not the  
correct tool, or perhaps I missed some config?

Thanks!

--  
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:** [October 14, 2013, 3:06pm UTC](https://discuss.elastic.co/t/can-phrasesuggester-search-distant-words/13942/2 "2013-10-14T15:06:26Z")

</div>

if you drop stopwords in your tokenizer that would work others that that it  
can but not necessarily score it high.

simon

On Monday, October 14, 2013 4:23:11 PM UTC+2, barak wrote:

> Hi,
> 
> Say I've the following text: "A keyboard and a mouse went to a bar", and  
> the user search for "keyboard mouse". Can the PhraseSuggester locate that  
> text? I know I can use the completion suggester and index the document with  
> multiple inputs, but then I have to figure out all the permutations of the  
> words in the text. I was wonder whether PhraseSuggester may be used for  
> that purpose, but some tests I ran failed to find the text. Is it not the  
> correct tool, or perhaps I missed some config?
> 
> Thanks!

--  
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:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [October 15, 2013, 4:00am UTC](https://discuss.elastic.co/t/can-phrasesuggester-search-distant-words/13942/3 "2013-10-15T04:00:21Z")

</div>

Hi,

If you are willing to index that text as ngrams your example query will  
match it.

## Otis

ELASTICSEARCH Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)  
Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)

On Monday, October 14, 2013 10:23:11 AM UTC-4, barak wrote:

> Hi,
> 
> Say I've the following text: "A keyboard and a mouse went to a bar", and  
> the user search for "keyboard mouse". Can the PhraseSuggester locate that  
> text? I know I can use the completion suggester and index the document with  
> multiple inputs, but then I have to figure out all the permutations of the  
> words in the text. I was wonder whether PhraseSuggester may be used for  
> that purpose, but some tests I ran failed to find the text. Is it not the  
> correct tool, or perhaps I missed some config?
> 
> Thanks!

--  
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:12am UTC](https://discuss.elastic.co/t/can-phrasesuggester-search-distant-words/13942/4 "2017-07-06T02:12:28Z")

</div>


