Remove a field from a Elasticsearch document

后端 未结 5 1095
长情又很酷
长情又很酷 2020-12-02 13:00

I need to remove a field in all the documents indexed to Elasticsearch . How can i do it. Will any of the delete queries help me achieve this.

5条回答
  •  隐瞒了意图╮
    2020-12-02 13:29

    By default it's not possible, because right now Lucene doesn't support that. Basically you can only put or remove whole Lucene documents from Lucene indices.

    1. Get the first version of your doc
    2. remove the field
    3. push this new version of your doc

    This answer is valid for version < ES 5.

提交回复
热议问题