# Suggesting search terms to search for

**URL:** <https://discuss.elastic.co/t/suggesting-search-terms-to-search-for/12842>\
**Category:** Elasticsearch\
**Created:** [July 18, 2013, 1:26pm UTC](https://discuss.elastic.co/t/suggesting-search-terms-to-search-for/12842 "2013-07-18T13:26:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrea\_Tarr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrea_tarr/32/2219_2.png) [@Andrea\_Tarr](https://discuss.elastic.co/u/Andrea_Tarr)\
**Post date:** [July 18, 2013, 1:26pm UTC](https://discuss.elastic.co/t/suggesting-search-terms-to-search-for/12842/1 "2013-07-18T13:26:54Z")

</div>

I have been working on an autocomplete function. I can make it work if I am  
doing an autocomplete on the document itself (i.e. display titles that  
match criteria as person types). However, what I want to do is suggest  
different search terms, not the actual documents.

For example, if the person types "data" they would see a drop down that  
said:  
data  
data sciences  
database  
data visualization  
data sciences community  
datastorage

I have a shingle analyzer that appropriately creates these tokens (as seen  
by using a analyze api on sample data) but I don't see how to get at those  
tokens directly.

I looked at using the facets, but what I need to return aren't fields from  
actual documents, just search tokens created from the document.

I played around with the new suggest api, but while it was good at dealing  
with misspellings, I couldn't see how to use it to suggest a fuller search  
term/phrase.

Am I missing something obvious or isn't this possible?

Thanks,  
Andy

--  
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:** ![Aaron\_Wolf](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@Aaron\_Wolf](https://discuss.elastic.co/u/Aaron_Wolf)\
**Post date:** [July 23, 2013, 8:03pm UTC](https://discuss.elastic.co/t/suggesting-search-terms-to-search-for/12842/2 "2013-07-23T20:03:33Z")

</div>

Hi Andy,

I've been searching for the same functionality but not sure it is currently  
offered in Elasticsearch.

My example is searching for "Steroids baseball" would suggest other terms  
like "Ryan" and "Braun".

Bumping this topic to see if someone else has a solution.

Thanks,  
Aaron

On Thursday, July 18, 2013 8:26:54 AM UTC-5, Andrea Tarr wrote:

> I have been working on an autocomplete function. I can make it work if I  
> am doing an autocomplete on the document itself (i.e. display titles that  
> match criteria as person types). However, what I want to do is suggest  
> different search terms, not the actual documents.
> 
> For example, if the person types "data" they would see a drop down that  
> said:  
> data  
> data sciences  
> database  
> data visualization  
> data sciences community  
> datastorage
> 
> I have a shingle analyzer that appropriately creates these tokens (as seen  
> by using a analyze api on sample data) but I don't see how to get at those  
> tokens directly.
> 
> I looked at using the facets, but what I need to return aren't fields from  
> actual documents, just search tokens created from the document.
> 
> I played around with the new suggest api, but while it was good at dealing  
> with misspellings, I couldn't see how to use it to suggest a fuller search  
> term/phrase.
> 
> Am I missing something obvious or isn't this possible?
> 
> Thanks,  
> Andy

--  
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:** [July 25, 2013, 11:25am UTC](https://discuss.elastic.co/t/suggesting-search-terms-to-search-for/12842/3 "2013-07-25T11:25:15Z")

</div>

Hi,

Why not index those terms and phrases in a separate index and query that  
during query entry?

## 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 Thursday, July 18, 2013 3:26:54 PM UTC+2, Andrea Tarr wrote:

> I have been working on an autocomplete function. I can make it work if I  
> am doing an autocomplete on the document itself (i.e. display titles that  
> match criteria as person types). However, what I want to do is suggest  
> different search terms, not the actual documents.
> 
> For example, if the person types "data" they would see a drop down that  
> said:  
> data  
> data sciences  
> database  
> data visualization  
> data sciences community  
> datastorage
> 
> I have a shingle analyzer that appropriately creates these tokens (as seen  
> by using a analyze api on sample data) but I don't see how to get at those  
> tokens directly.
> 
> I looked at using the facets, but what I need to return aren't fields from  
> actual documents, just search tokens created from the document.
> 
> I played around with the new suggest api, but while it was good at dealing  
> with misspellings, I couldn't see how to use it to suggest a fuller search  
> term/phrase.
> 
> Am I missing something obvious or isn't this possible?
> 
> Thanks,  
> Andy

--  
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:24am UTC](https://discuss.elastic.co/t/suggesting-search-terms-to-search-for/12842/4 "2017-07-06T02:24:35Z")

</div>


