# Query for automplete feature?

**URL:** <https://discuss.elastic.co/t/query-for-automplete-feature/215949>\
**Category:** Elasticsearch\
**Created:** [January 21, 2020, 8:33pm UTC](https://discuss.elastic.co/t/query-for-automplete-feature/215949 "2020-01-21T20:33:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rishabh\_jain](https://avatars.discourse-cdn.com/v4/letter/r/aeb1de/32.png) [@rishabh\_jain](https://discuss.elastic.co/u/rishabh_jain)\
**Post date:** [January 21, 2020, 8:33pm UTC](https://discuss.elastic.co/t/query-for-automplete-feature/215949/1 "2020-01-21T20:33:37Z")

</div>

should we use edge\_ngram for autocomplete?  
If yes will it have any any impact on query execution?  
If no then what is the use of ngram if one can search using query\_string query?

Also let suppose want to create ngram of a field whose value is like "fname lname email phone\_number" and all the documents will have value with this format is it feasible to create of ngrams of this field consider total documents \> 1000 and each document will have this field?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 22, 2020, 2:21pm UTC](https://discuss.elastic.co/t/query-for-automplete-feature/215949/2 "2020-01-22T14:21:40Z")

</div>

Take a look at the relatively new [search-as-you-type datatype](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/search-as-you-type.html), maybe just reusing that datatype without special configuration is already enough for your use-case.

---

<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:** [February 19, 2020, 2:33pm UTC](https://discuss.elastic.co/t/query-for-automplete-feature/215949/3 "2020-02-19T14:33:46Z")

</div>

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