Change Text mapping to Double/Number

Hi,

I need to change the mapping of a field 'AmountExcVat' from Text to double.
image

I have tried:

image

but I am getting the following error:

Can someone help me please?

Thanks in advance,
Amy

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 API
  • the most likely best solution would be to reindex into a new index.

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