Elasticsearch - mapper attachment plugin

Hi,

I'm trying to index big document with ES and Mapper Attachment plugin. In the configuration below:

PUT /test-mapping/person/1
{
"my_attachment" : {
"_name" : "/home/ubuntu/test.pdf",
"_language" : "en",
"_content" : "... base64 encoded attachment ..." ---> Do I have to input bas64 encoded content of the complete file? Is there any other way?
}
}

If there are multiple files, what is the solution to handle this? First convert all the file content to base 64 and then write curl PUT for all the files in a script?

Do I have to input bas64 encoded content of the complete file?

Yes.

Is there any other way?

Extract yourself on the client side your text using Tika.

Also have a look at this new feature and the comments on the PR itself: https://github.com/elastic/elasticsearch/pull/16490