# Change Text mapping to Double/Number

**URL:** <https://discuss.elastic.co/t/change-text-mapping-to-double-number/304047>\
**Category:** Kibana\
**Created:** [May 5, 2022, 2:40pm UTC](https://discuss.elastic.co/t/change-text-mapping-to-double-number/304047 "2022-05-05T14:40:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AmyMCollins](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@AmyMCollins](https://discuss.elastic.co/u/AmyMCollins)\
**Post date:** [May 5, 2022, 2:40pm UTC](https://discuss.elastic.co/t/change-text-mapping-to-double-number/304047/1 "2022-05-05T14:40:05Z")

</div>

Hi,

I need to change the mapping of a field 'AmountExcVat' from Text to double.  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/4/04efd7495878a5c711f6eb457419fcc73ba674d0.png)

I have tried:

![image](https://us1.discourse-cdn.com/elastic/original/3X/d/6/d61a87b4d757e33ead3762839d47d617afc3ce5a.png)

but I am getting the following error:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/5/b50f16eb0c07b8ca03d47e68fd955e17338fa044.png)

Can someone help me please?

Thanks in advance,  
Amy

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [May 5, 2022, 3:58pm UTC](https://discuss.elastic.co/t/change-text-mapping-to-double-number/304047/2 "2022-05-05T15:58:03Z")

</div>

You cannot change the mapping of an indexed document directly. You may

- Ingest again with the correct mapping
- add a new field to receive the converted value using [\_update\_by\_query](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html#docs-update-by-query-api-source) API
- the most likely best solution would be to [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#reindex-scripts) into a new index.

Both methods accept a painless script where you can perform your change, check the links I shared.

---

<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:** [June 2, 2022, 3:58pm UTC](https://discuss.elastic.co/t/change-text-mapping-to-double-number/304047/3 "2022-06-02T15:58:37Z")

</div>

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