# \[7.5.0\] Transforming .raw into .keyword

**URL:** <https://discuss.elastic.co/t/7-5-0-transforming-raw-into-keyword/210713>\
**Category:** Elasticsearch\
**Created:** [December 5, 2019, 12:45pm UTC](https://discuss.elastic.co/t/7-5-0-transforming-raw-into-keyword/210713 "2019-12-05T12:45:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabio-sama](https://avatars.discourse-cdn.com/v4/letter/f/b9e5f3/32.png) [@Fabio-sama](https://discuss.elastic.co/u/Fabio-sama)\
**Post date:** [December 5, 2019, 12:45pm UTC](https://discuss.elastic.co/t/7-5-0-transforming-raw-into-keyword/210713/1 "2019-12-05T12:45:43Z")

</div>

Hi there!

As the thread title states, my concern here is to loop through a specific index (maybe with an ingest pipeline) and - if possible - transform the nested .raw value into an equivalent .keyword value.

I need this since I did a reindex from a 5.0.0 to a 7.5.0 and everything went fine. Though I now have the old documents with .raw nested fields, while the new docs I'm ingesting into that index are obvously ingested with the classic .keyword.

So, if I make a visualization I have to choose if aggregate over .raw fields or .keyword fields, and that is a problem.

Any idea on how I can convert all the docs with the old standard into docs with the new standard? Being a mapping problem I'm not sure this is even possible, that's why I'm asking.

Thank you so much!

---

<div class="post-metadata">

**Author:** ![Fabio-sama](https://avatars.discourse-cdn.com/v4/letter/f/b9e5f3/32.png) [@Fabio-sama](https://discuss.elastic.co/u/Fabio-sama)\
**Post date:** [December 5, 2019, 12:55pm UTC](https://discuss.elastic.co/t/7-5-0-transforming-raw-into-keyword/210713/2 "2019-12-05T12:55:10Z")

</div>

Never mind, stupid question. As I imagined it is obviously all a mapping problem. So it was sufficient to force the mapping on the landing index in the first place.

A new index (with a new template) plus a reindex forth and back fixed everything 🙂

---

<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 2, 2020, 12:55pm UTC](https://discuss.elastic.co/t/7-5-0-transforming-raw-into-keyword/210713/3 "2020-01-02T12:55:17Z")

</div>

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