# Term Aggregate on Analyzed Fields?

**URL:** <https://discuss.elastic.co/t/term-aggregate-on-analyzed-fields/20421>\
**Category:** Elasticsearch\
**Created:** [October 24, 2014, 2:32pm UTC](https://discuss.elastic.co/t/term-aggregate-on-analyzed-fields/20421 "2014-10-24T14:32:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhughes](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@mhughes](https://discuss.elastic.co/u/mhughes)\
**Post date:** [October 24, 2014, 2:32pm UTC](https://discuss.elastic.co/t/term-aggregate-on-analyzed-fields/20421/1 "2014-10-24T14:32:39Z")

</div>

I have a field with values like:

foo  
bar  
bar-one

Unfortunately, when I set up this index, I didn't realize that I wanted to  
turn off tokenization ("index": "not\_analyzed"). Now when I try and do  
terms aggregation, I get back the tokenized values:

foo  
bar (2)  
one

Is there any way to do an aggregation on the full value of the field,  
ignoring tokenization?

--  
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/1b975d21-a69e-4dca-ab27-b0c39650e571%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1b975d21-a69e-4dca-ab27-b0c39650e571%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![11169](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/11169/32/1158_2.png) [@11169](https://discuss.elastic.co/u/11169)\
**Post date:** [October 24, 2014, 3:02pm UTC](https://discuss.elastic.co/t/term-aggregate-on-analyzed-fields/20421/2 "2014-10-24T15:02:58Z")

</div>

As far as I know, you can not do this, because ES do not store field value by default(It uses ‘\_source’). If ES read the value from ‘\_source’, it will cost a long time.

> 在 2014年10月24日，下午10:32，Matt Hughes [hughes.matt@gmail.com](mailto:hughes.matt@gmail.com) 写道：
> 
> I have a field with values like:
> 
> foo  
> bar  
> bar-one
> 
> Unfortunately, when I set up this index, I didn't realize that I wanted to turn off tokenization ("index": "not\_analyzed"). Now when I try and do terms aggregation, I get back the tokenized values:
> 
> foo  
> bar (2)  
> one
> 
> Is there any way to do an aggregation on the full value of the field, ignoring tokenization?
> 
> --  
> 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) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1b975d21-a69e-4dca-ab27-b0c39650e571%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1b975d21-a69e-4dca-ab27-b0c39650e571%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/1b975d21-a69e-4dca-ab27-b0c39650e571%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/1b975d21-a69e-4dca-ab27-b0c39650e571%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/9E1F7BF4-A662-4054-802C-B86DF389B8BC%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/9E1F7BF4-A662-4054-802C-B86DF389B8BC%40gmail.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:53am UTC](https://discuss.elastic.co/t/term-aggregate-on-analyzed-fields/20421/3 "2017-07-06T00:53:58Z")

</div>


