# Best way to build DidYouMean feature

**URL:** <https://discuss.elastic.co/t/best-way-to-build-didyoumean-feature/188940>\
**Category:** Elasticsearch\
**Created:** [July 4, 2019, 3:20pm UTC](https://discuss.elastic.co/t/best-way-to-build-didyoumean-feature/188940 "2019-07-04T15:20:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edoardo.zanon](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@edoardo.zanon](https://discuss.elastic.co/u/edoardo.zanon)\
**Post date:** [July 4, 2019, 3:20pm UTC](https://discuss.elastic.co/t/best-way-to-build-didyoumean-feature/188940/1 "2019-07-04T15:20:03Z")

</div>

Hi, i've an search service based on elasticsearch.

I need to build the DidYouMean feature based on a filter and a simple requirement:

- match against two array filter
- correct the word for produce secure result (the word innested in a query must produce one or more result)
- suggest from multiple fields

I've seen two way:  
1 - Use phrase autocomplete with match\_against feature (on standard tokenized fields)  
2 - Use search with fuzzy (on standard tokenized fields)

With the first solution, I must make multiple autocomplete request in the second one (autocomplete doesn't permit multiple fields in request)  
With the first solution, I need to make applicative logic to check the result.

What is the best way to perform this search? (performance & CPU load in elasticsearch)  
Is correct to use the standard tokenized field for suggestion?

---

<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:** [August 1, 2019, 3:20pm UTC](https://discuss.elastic.co/t/best-way-to-build-didyoumean-feature/188940/2 "2019-08-01T15:20:11Z")

</div>

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