Hi there, im trying to post multiple attachments for index. Same example we have on official. This is my mapping:
PUT _ingest/pipeline/attachment
{
"description" : "Extract attachment information from arrays",
"processors" : [
{
"foreach": {
"field": "attachments",
"processor": {
"attachment": {
"target_field": "_ingest._value.attachment",
"field": "_ingest._value.data"
}
}
}
}
]
}
This is a main body:
{
"attachments" : [
{
"filename" : "ipsum.txt",
"data" : "dGhpcyBpcwpqdXN0IHNvbWUgdGV4dAo="
},
{
"filename" : "test.txt",
"data" : "VGhpcyBpcyBhIHRlc3QK"
}
]
}
Im getting response:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "failed to parse field [attachments] of type [text] in document with id '203'. Preview of field's value: '{filename=ipsum.txt, data=dGhpcyBpcwpqdXN0IHNvbWUgdGV4dAo=, attachment={content_type=text/plain; charset=ISO-8859-1, language=en, content=this is\njust some text, content_length=24}}'"
}
],
"type": "mapper_parsing_exception",
"reason": "failed to parse field [attachments] of type [text] in document with id '203'. Preview of field's value: '{filename=ipsum.txt, data=dGhpcyBpcwpqdXN0IHNvbWUgdGV4dAo=, attachment={content_type=text/plain; charset=ISO-8859-1, language=en, content=this is\njust some text, content_length=24}}'",
"caused_by": {
"type": "illegal_state_exception",
"reason": "Can't get text on a START_OBJECT at 1:17"
}
},
"status": 400
}
I would apprechiate any suggestion on, what's wrong here, i guess mapping should be changed, but not sure (new to elastic).
Thanks