1

How to remove unwanted attributes containing values from a document in an index in Elasticsearch

We created additionalattr1, additionalattr2 in an index by mistake and they don't have a mapping either, what would be the best way to remove these in production.

additionalattr1 is a nested attribute, but mistakenly created in a flat structure within the document

"pi.ei.additionalattr1" : "Finance / CA / CS/ CFA / Others",
"pi.ei.additionalattr2" : "Finance",
Rpj
  • 5,348
  • 16
  • 62
  • 122
  • This could help you : https://stackoverflow.com/questions/29002215/remove-a-field-from-a-elasticsearch-document – YLR Sep 20 '21 at 17:48

1 Answers1

0

the only way to remove these is to reindex your data. this can be done by;

  1. an _update script as YLR mentioned above
  2. a _reindex into a new index
  3. or from your source data, outside of Elasticsearch
warkolm
  • 1,933
  • 1
  • 4
  • 12