# How do you build query suggester like Google/Amazon? Suggest by token instead of suggesting a result

**URL:** <https://discuss.elastic.co/t/how-do-you-build-query-suggester-like-google-amazon-suggest-by-token-instead-of-suggesting-a-result/213268>\
**Category:** Elasticsearch\
**Created:** [December 28, 2019, 9:40pm UTC](https://discuss.elastic.co/t/how-do-you-build-query-suggester-like-google-amazon-suggest-by-token-instead-of-suggesting-a-result/213268 "2019-12-28T21:40:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brac\_Macke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brac_macke/32/50344_2.png) [@Brac\_Macke](https://discuss.elastic.co/u/Brac_Macke)\
**Post date:** [December 28, 2019, 9:40pm UTC](https://discuss.elastic.co/t/how-do-you-build-query-suggester-like-google-amazon-suggest-by-token-instead-of-suggesting-a-result/213268/1 "2019-12-28T21:40:16Z")

</div>

![](https://us1.discourse-cdn.com/elastic/original/3X/b/3/b335e8248fdd5173fc096c245a798694c39dade9.gif)

This feature is available on Elastic App Search, but I want to implement this kind of suggestion using Elasticsearch.

I've been messing around this for 3 days straight with no luck. My closest approach to this is to use the completion suggester, by splitting the words in a sentence to form a shingle (manually with nodeJS and some regex & for loops), and then using those shingles as an input in the completion suggester. I am sure there is a better way.

Any idea on how to this better? I'd very much appreciate any pointers you can give 🙂

---

<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:** [January 25, 2020, 9:40pm UTC](https://discuss.elastic.co/t/how-do-you-build-query-suggester-like-google-amazon-suggest-by-token-instead-of-suggesting-a-result/213268/2 "2020-01-25T21:40:23Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
