在 elasticsearch 7.15 中摄取期间从 _source 字段中按需删除子字段

remove sub-field on demand from _source field during ingestion in elasticsearch 7.15

我有一个用 base64 编码的非常大的数据字段,这在摄取过程中给我带来了麻烦,我想将它从 _source 中删除,但我做不到,如何实现这一点,但在 _source 字段中保留该索引的其他字段?

我尝试在摄取管道中使用移除处理器,但没有成功:

 {
   remove:{ field:"_source.data"}
 }

示例文档:

POST _ingest/pipeline/attachment/_simulate
  {
  "docs": [
  {
  "_index": "myindex",
  "_id": "pdf_doc",
  "_source": {
      "data": "1e1xydGYxXGFuc2kNCkxvgrgecmVtIGlwc3VtfrreIGRvbG9yIHNpdCBhbWVgr0DQpccGFyIH0="
  }
 }
]
}

此处记录了语法 -

https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html#include-exclude