# Elasticsearch Non Analyzed Fields Regex aggregation

**URL:** <https://discuss.elastic.co/t/elasticsearch-non-analyzed-fields-regex-aggregation/2779>\
**Category:** Elasticsearch\
**Created:** [June 16, 2015, 10:42am UTC](https://discuss.elastic.co/t/elasticsearch-non-analyzed-fields-regex-aggregation/2779 "2015-06-16T10:42:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiran\_Sriharsha](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@Kiran\_Sriharsha](https://discuss.elastic.co/u/Kiran_Sriharsha)\
**Post date:** [June 16, 2015, 10:42am UTC](https://discuss.elastic.co/t/elasticsearch-non-analyzed-fields-regex-aggregation/2779/1 "2015-06-16T10:42:00Z")

</div>

Hi Everyone

I am implementing one feature which includes city names (Example: "New York", "San Francisco"). I need to find document count at run time when user is typing the word. More like auto complete with counts.

Scenario:  
Input: "Ne"  
Output: "New York - 100 documents"

For this usecase in mind:  
I created two fields namely cities(type: string, standard analyzer) and cities\_non\_analyzed (type: string, non analyzed).

But I am not able to apply it on non analyzed cities field using include in aggregations to get counts for the words that are matched in analyzed field.

Any pointer will be of good help

Thanks  
Sri Harsha

---

<div class="post-metadata">

**Author:** ![Kiran\_Sriharsha](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@Kiran\_Sriharsha](https://discuss.elastic.co/u/Kiran_Sriharsha)\
**Post date:** [June 16, 2015, 11:20am UTC](https://discuss.elastic.co/t/elasticsearch-non-analyzed-fields-regex-aggregation/2779/2 "2015-06-16T11:20:51Z")

</div>

Hi

I got a solution for this.

I am not able to delete this quesiton !! Can someone with appropriate rights delete the question.

Thanks  
Sri Harsha

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 17, 2015, 4:15am UTC](https://discuss.elastic.co/t/elasticsearch-non-analyzed-fields-regex-aggregation/2779/3 "2015-06-17T04:15:59Z")

</div>

Why not share your solution so others can learn as well?

---

<div class="post-metadata">

**Author:** ![SekharJami](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@SekharJami](https://discuss.elastic.co/u/SekharJami)\
**Post date:** [February 1, 2016, 10:18am UTC](https://discuss.elastic.co/t/elasticsearch-non-analyzed-fields-regex-aggregation/2779/4 "2016-02-01T10:18:43Z")

</div>

Hi Harsha,

I am also currently facing the same issue. It would be nice if you could share your solution.

Thanks,  
Sekhar

---

<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 5, 2017, 11:19pm UTC](https://discuss.elastic.co/t/elasticsearch-non-analyzed-fields-regex-aggregation/2779/5 "2017-07-05T23:19:57Z")

</div>


