# Postal address autocomplete

**URL:** <https://discuss.elastic.co/t/postal-address-autocomplete/348022>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [November 27, 2023, 8:12am UTC](https://discuss.elastic.co/t/postal-address-autocomplete/348022 "2023-11-27T08:12:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnwc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnwc/32/128064_2.png) [@johnwc](https://discuss.elastic.co/u/johnwc)\
**Post date:** [November 27, 2023, 8:12am UTC](https://discuss.elastic.co/t/postal-address-autocomplete/348022/1 "2023-11-27T08:12:15Z")

</div>

We are currently evaluating an installation and trying to setup an index for address autocompletion for our users on our site. So that as a user starts typing an address, and possible matches start showing up for them to select. What kind of index mapping do you suggest? Our index contains all address fields separated out, ex street number, street, city, state, postal code, lat, long. Would also be nice to be able to let the search know the users lat/long so it matches address closes to users location, maybe a sort?

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [December 6, 2023, 7:42pm UTC](https://discuss.elastic.co/t/postal-address-autocomplete/348022/2 "2023-12-06T19:42:12Z")

</div>

Hi @johnwc,

Have you considered [Elastic App Search](https://www.elastic.co/guide/en/app-search/current/index.html)? In particular, you might be interested in the Result Suggestion feature: [Result Suggestions Guide | App Search documentation [8.11] | Elastic](https://www.elastic.co/guide/en/app-search/current/result-suggestions-guide.html)

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 7, 2023, 5:09am UTC](https://discuss.elastic.co/t/postal-address-autocomplete/348022/3 "2023-12-07T05:09:39Z")

</div>

Hi @johnwc Welcome to the community!

I also suggest looking at

`search_as_you_type`

> **[Search-as-you-type field type | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-as-you-type.html)**

I think this works best though if you re-concatenate all the parts into a single field.

This would work a lot like when you start typing an address into Google maps...

The spatial component can be a bit tricky if you want to use it, but you certainly could do within a radius or filter by a ZIP code or a state or some other geographic area

This would be with straight/core elasticsearch.

---

<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 4, 2024, 5:09am UTC](https://discuss.elastic.co/t/postal-address-autocomplete/348022/4 "2024-01-04T05:09:57Z")

</div>

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