# Typeahead/Completion With Has\_Child

**URL:** <https://discuss.elastic.co/t/typeahead-completion-with-has-child/20206>\
**Category:** Elasticsearch\
**Created:** [October 12, 2014, 1:07pm UTC](https://discuss.elastic.co/t/typeahead-completion-with-has-child/20206 "2014-10-12T13:07:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Delaney](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_delaney/32/1095_2.png) [@Michael\_Delaney](https://discuss.elastic.co/u/Michael_Delaney)\
**Post date:** [October 12, 2014, 1:07pm UTC](https://discuss.elastic.co/t/typeahead-completion-with-has-child/20206/1 "2014-10-12T13:07:24Z")

</div>

Hi,

I'm trying to create a typeahead where people get autocomplete using text  
from a child but returning a parent.

The idea is that all the variations of parent are stored in child  
documents, but when a user searches we only show the parent.

I have it working at the moment using a has\_child search but wanted to know  
if there was a way to use the completion suggester & has\_child  
for a better user experience.

for example:

parent: "New York:

child: "New York City"  
child: "Buffalo"

someone types "buff"  
they get "New York" returned.

Does that make sense???

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6f192fcb-b03e-4cee-adc2-b78c93da2131%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6f192fcb-b03e-4cee-adc2-b78c93da2131%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:56am UTC](https://discuss.elastic.co/t/typeahead-completion-with-has-child/20206/2 "2017-07-06T00:56:41Z")

</div>


