# Getting the error after upgrading from v6 to v7

**URL:** <https://discuss.elastic.co/t/getting-the-error-after-upgrading-from-v6-to-v7/339034>\
**Category:** Kibana\
**Created:** [July 24, 2023, 5:04am UTC](https://discuss.elastic.co/t/getting-the-error-after-upgrading-from-v6-to-v7/339034 "2023-07-24T05:04:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonujatav35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonujatav35/32/90308_2.png) [@sonujatav35](https://discuss.elastic.co/u/sonujatav35)\
**Post date:** [July 24, 2023, 5:04am UTC](https://discuss.elastic.co/t/getting-the-error-after-upgrading-from-v6-to-v7/339034/1 "2023-07-24T05:04:52Z")

</div>

Hi ES community,

I have one question recently i have done reindexing then ES up-gradation from v6.8.23 to v7.17.9. After this operation i noticed some error in elastic-search.

```auto
Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations a
re disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [TARGET_NAME] in order to load field data by uninverting the inverted index.

```

I would like to know How can i change this default option and what would be the step?

Thanks  
Sonu

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [July 24, 2023, 1:37pm UTC](https://discuss.elastic.co/t/getting-the-error-after-upgrading-from-v6-to-v7/339034/2 "2023-07-24T13:37:09Z")

</div>

Hi @sonujatav35,

It looks like you are performing aggregations (perhaps in some dashboard visualizations) using a `text` type field rather than a `keyword` type field. Are you able to change your query/ visualization to use the `keyword` field instead?

---

<div class="post-metadata">

**Author:** ![sonujatav35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonujatav35/32/90308_2.png) [@sonujatav35](https://discuss.elastic.co/u/sonujatav35)\
**Post date:** [July 25, 2023, 3:54am UTC](https://discuss.elastic.co/t/getting-the-error-after-upgrading-from-v6-to-v7/339034/3 "2023-07-25T03:54:52Z")

</div>

Thanks for the suggestion as of now I have not updated my query but let me try update it accordingly. If i do not want to change Dashboards visualizations query then this(fielddata=true) option i have to append to my query?

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [July 25, 2023, 8:44am UTC](https://discuss.elastic.co/t/getting-the-error-after-upgrading-from-v6-to-v7/339034/4 "2023-07-25T08:44:31Z")

</div>

You would need to amend the index mapping. There is an [update example here](https://www.elastic.co/guide/en/elasticsearch/reference/8.8/text.html#enable-fielddata-text-fields). However I would read the [caveats listed here carefully](https://www.elastic.co/guide/en/elasticsearch/reference/8.8/text.html#before-enabling-fielddata) as there is a memory impact of enabling this setting.

---

<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 22, 2023, 8:45am UTC](https://discuss.elastic.co/t/getting-the-error-after-upgrading-from-v6-to-v7/339034/5 "2023-08-22T08:45:02Z")

</div>

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