I've done a foolish thing and created a large number of fields in the format
"fingerprint.attachment_5C6C2D4E000092B707F41EF1" : "Attachment 5C6C2D4E000092B707F41EF1.gif is an IMAGE and therfore NOT processed"
I used an underscore rather than a period
I'm trying to reindex to remove these fields using this pipeline but it's not working. Can anybody point out where I'm going wrong.
PUT _ingest/pipeline/remove-fingerprint-attachment-field
{
"description" : "Remove Fingerprint Attachment Field pipeline",
"processors" : [
{
"foreach" : {
"field" : "fingerprint",
"processor" : {
"script": {
"lang": "painless",
"source": "if (ctx._ingest._value.contains(params.field_part)) {ctx._ingest_value.remove}",
"params": {
"params":
{"field_part":"attachment_"}
}
}
}
}
}
]
}
The error is
"cause": {
"type": "exception",
"reason": "java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: field [fingerprint] not present as part of path [fingerprint]",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "java.lang.IllegalArgumentException: field [fingerprint] not present as part of path [fingerprint]",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "field [fingerprint] not present as part of path [fingerprint]"
}
},
"header": {
"processor_type": "foreach"
}
}