# How to use the unanalyzed field when its analyzed?

**URL:** <https://discuss.elastic.co/t/how-to-use-the-unanalyzed-field-when-its-analyzed/93257>\
**Category:** Elasticsearch\
**Created:** [July 15, 2017, 10:28am UTC](https://discuss.elastic.co/t/how-to-use-the-unanalyzed-field-when-its-analyzed/93257 "2017-07-15T10:28:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![qkhanhpro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/qkhanhpro/32/20086_2.png) [@qkhanhpro](https://discuss.elastic.co/u/qkhanhpro)\
**Post date:** [July 15, 2017, 10:28am UTC](https://discuss.elastic.co/t/how-to-use-the-unanalyzed-field-when-its-analyzed/93257/1 "2017-07-15T10:28:09Z")

</div>

Hi everyone, I got into the same problem that is found here

[http://thomasardal.com/terms-aggregations-on-analyzed-fields-in-elasticsearch/](http://thomasardal.com/terms-aggregations-on-analyzed-fields-in-elasticsearch/)

The problem is, we already got our data indexed with "analyzed" option ,  
Is there anyway we can revert the process / use the "unanalyzed" texts to get the aggregation we wanted?

Sorry for the basic question and thank you very much

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 15, 2017, 12:17pm UTC](https://discuss.elastic.co/t/how-to-use-the-unanalyzed-field-when-its-analyzed/93257/2 "2017-07-15T12:17:19Z")

</div>

You will need to alter mappings and reindex the data to make such a change.

---

<div class="post-metadata">

**Author:** ![qkhanhpro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/qkhanhpro/32/20086_2.png) [@qkhanhpro](https://discuss.elastic.co/u/qkhanhpro)\
**Post date:** [July 17, 2017, 2:40am UTC](https://discuss.elastic.co/t/how-to-use-the-unanalyzed-field-when-its-analyzed/93257/3 "2017-07-17T02:40:16Z")

</div>

Thank you, Christian.

So that mean its impossible wihout the original data, right?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 17, 2017, 5:12am UTC](https://discuss.elastic.co/t/how-to-use-the-unanalyzed-field-when-its-analyzed/93257/4 "2017-07-17T05:12:23Z")

</div>

Unless you have disabled the `_source` field, you should be able to used the [reindex API](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-reindex.html) to reindex from your current index.

---

<div class="post-metadata">

**Author:** ![Ravi\_Shanker\_Reddy](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@Ravi\_Shanker\_Reddy](https://discuss.elastic.co/u/Ravi_Shanker_Reddy)\
**Post date:** [July 17, 2017, 5:53pm UTC](https://discuss.elastic.co/t/how-to-use-the-unanalyzed-field-when-its-analyzed/93257/5 "2017-07-17T17:53:09Z")

</div>

Check either data.keyword is available in your index or not??? If you have  
that you can directly use that.

---

<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:** [August 14, 2017, 5:53pm UTC](https://discuss.elastic.co/t/how-to-use-the-unanalyzed-field-when-its-analyzed/93257/6 "2017-08-14T17:53:46Z")

</div>

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