# Is there a "real" autocomplete anymore in elastic?

**URL:** <https://discuss.elastic.co/t/is-there-a-real-autocomplete-anymore-in-elastic/95531>\
**Category:** Elasticsearch\
**Created:** [August 2, 2017, 1:11pm UTC](https://discuss.elastic.co/t/is-there-a-real-autocomplete-anymore-in-elastic/95531 "2017-08-02T13:11:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![initproto](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@initproto](https://discuss.elastic.co/u/initproto)\
**Post date:** [August 2, 2017, 1:11pm UTC](https://discuss.elastic.co/t/is-there-a-real-autocomplete-anymore-in-elastic/95531/1 "2017-08-02T13:11:07Z")

</div>

Hi,  
For the life of me, I can't understand why elastic changed the useful and common use-case of finding autocompletion words and abandoned it for entire document results? Who and why was this decision made? It creates many more problems than it attempts to solve.

Why would I want to auto-complete a document? That makes no sense at all. Before, I can autocomplete words and phrases and pull the document if I needed it.

What is the fix for this bug?

thank you.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 2, 2017, 2:38pm UTC](https://discuss.elastic.co/t/is-there-a-real-autocomplete-anymore-in-elastic/95531/2 "2017-08-02T14:38:37Z")

</div>

It depends on the use case but I'd not qualify it as a bug but as an enriched feature. 😃

May be explain with a full example what exactly your problem is and we will try to help you solving it.

---

<div class="post-metadata">

**Author:** ![initproto](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@initproto](https://discuss.elastic.co/u/initproto)\
**Post date:** [August 2, 2017, 2:56pm UTC](https://discuss.elastic.co/t/is-there-a-real-autocomplete-anymore-in-elastic/95531/3 "2017-08-02T14:56:42Z")

</div>

Ok. Thanks.

A user starts typing in a search box and wants to see qualifying words and phrases that begin with their text. I did find a way to do this, but I have to keep a separate document type and mapping to support it. Apparently, I can't complete words in lists of a document and return only those words. I don't want to return all \_source and then have to figure it out separately.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 2, 2017, 3:11pm UTC](https://discuss.elastic.co/t/is-there-a-real-autocomplete-anymore-in-elastic/95531/4 "2017-08-02T15:11:19Z")

</div>

I understand the problem. I was asking for a script to reproduce it.

Like it is described in:

> [@About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21):
>
> The heart of the free and open Elastic Stack Elasticsearch is a distributed, RESTful search and analytics engine capable of addressing a growing number of use cases. As the heart of the Elastic Stack, it centrally stores your data for lightning fast search, fine‑tuned relevancy, and powerful analytics that scale with ease. warning PLEASE READ THIS SECTION IF IT'S YOUR FIRST POST Some useful links: [elasticsearch reference guide](http://www.elastic.co/guide/en/elasticsearch/reference/current/index.html)[elasticsearch user guide](http://www.elastic.co/guide/en/elasticsearch/guide/current/index.html)[elasticsearch plugins](https://www.elastic.co/guide/en/elasticsearch/plugins/current/index.html)[elasticsearch cl…](https://www.elastic.co/guide/en/elasticsearch/client/index.html)

---

<div class="post-metadata">

**Author:** ![initproto](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@initproto](https://discuss.elastic.co/u/initproto)\
**Post date:** [August 2, 2017, 5:07pm UTC](https://discuss.elastic.co/t/is-there-a-real-autocomplete-anymore-in-elastic/95531/5 "2017-08-02T17:07:13Z")

</div>

Well, I guess this is a feature decision of elastic to not be able to return autocomplete suggestions of document fields and return only those matching fields. instead it returns entire document. To get anywhere close to basic autocomplete, I have to set up completely separate indexes with only the fields I want to autocomplete on as their own documents and then hope these separate indexes stay in sync with my master document index.

I really don't see why elastic can't make this easier.

Document A:

{  
"name": .....  
"address": ....  
"title": ....  
}

I want to accept some query string and then ask for any matching fields of documents where they complete the query string. I don't necessarily know in advance which fields those might be and I don't want to construct a query enumerating all the fields. Which could easily change over time in the index.

As a result, I want list of matching fields and doc id's and the value of the matched field. Pretty simple. And a very common use case elastic just does not support easily.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 2, 2017, 5:28pm UTC](https://discuss.elastic.co/t/is-there-a-real-autocomplete-anymore-in-elastic/95531/6 "2017-08-02T17:28:25Z")

</div>

Sorry. I can't help without a script.

---

<div class="post-metadata">

**Author:** ![initproto](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@initproto](https://discuss.elastic.co/u/initproto)\
**Post date:** [August 2, 2017, 5:47pm UTC](https://discuss.elastic.co/t/is-there-a-real-autocomplete-anymore-in-elastic/95531/7 "2017-08-02T17:47:06Z")

</div>

There is no script. The title of the post is a question, which requires a yes or no answer. If you understand the question (see the title of the post) and the problem behind it, then I think you have everything needed to offer some suggestion. There is nothing to reproduce because the post is inquiring about a lack of capability, not a broken existing capability.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 2, 2017, 6:28pm UTC](https://discuss.elastic.co/t/is-there-a-real-autocomplete-anymore-in-elastic/95531/8 "2017-08-02T18:28:21Z")

</div>

I think there is a solution. It's explained somewhere here: [https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-suggesters-completion.html#querying](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-suggesters-completion.html#querying)

---

<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 30, 2017, 6:28pm UTC](https://discuss.elastic.co/t/is-there-a-real-autocomplete-anymore-in-elastic/95531/9 "2017-08-30T18:28:24Z")

</div>

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