Elasticsearch Deleting a field in an index

Hi,

I have an index that is being populated in realtime. However, I have one field in the index which I don't need anymore. Is there anyway to delete just one field from an index for all documents?

Thanks in advance.
Cheers,
Balaji

Hi @astrobalaji,

you can use update by query to remove the field from all docs, see: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html . You have to use a script in order to remove the field from each document.

1 Like

Thanks :slight_smile:
But the field is still in the mapping though. Is it possible to delete the field from the mapping??

You can't. You need to create a new index for that.
Or if you have a platinum license, you can hide this field from all the users but the "admin".

1 Like

ok. Thanks :slight_smile:

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