# Tags and aliases

**URL:** <https://discuss.elastic.co/t/tags-and-aliases/11545>\
**Category:** Elasticsearch\
**Created:** [April 11, 2013, 10:13am UTC](https://discuss.elastic.co/t/tags-and-aliases/11545 "2013-04-11T10:13:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matei/32/2393_2.png) [@Matei](https://discuss.elastic.co/u/Matei)\
**Post date:** [April 11, 2013, 10:13am UTC](https://discuss.elastic.co/t/tags-and-aliases/11545/1 "2013-04-11T10:13:48Z")

</div>

Hi guys,

I'm trying to build a fast auto-complete box that searches through hundreds  
of thousands of tags and their aliases, prioritizing results based on tag  
popularity (similar to how [maps.google.com](http://maps.google.com) search works) - the popularity  
will be constructed over time, in a separate database, based on number of  
times user selected each tag from the autocomplete box.

Let's say I have "Madrid, Spain" and "Madrid, NM, United States" in the  
database. Searching for "Mad" should show Madrid, Spain first and Madrid,  
NM, United States after.

Also tags can have aliases, like: "Comunidad de Madrid", "capital of spain"

I'm not sure how to

1. index the aliases
2. what analyzer to use to make sure the matching only takes into account  
beginning of words ( "drid" should not match "Madrid")

I hope this is not a silly already-answered question 🙂

Thanks!

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:41am UTC](https://discuss.elastic.co/t/tags-and-aliases/11545/2 "2017-07-06T02:41:36Z")

</div>


