Elasticsearch: Add a document with an attachment
This documentation is part of the Ingest Attachment Plugin guide. You can view the complete guide here: How to extract data from PPT, XLS, and PDF files to Elasticsearch.
👋 Welcome to the Stackhero documentation
Stackhero offers a fully managed Elasticsearch cloud service, designed for professionals who require reliable search, analytics, and logging at scale.
- Consistent performance and enhanced security with a private, dedicated infrastructure.
- Easily set up a custom domain name secured by HTTPS.
Get started quickly and focus on your business: you can have a production-ready Elasticsearch cloud hosting environment in around 5 minutes, with routine maintenance and security managed for you.
Now you can index a document that contains an attachment. The document should include a data field that holds the file content encoded in Base64. In this example, the document is an RTF file containing the sentence "This is the content of an RTF file":
PUT my_index/_doc/my_id?pipeline=attachment
{
"data": "e1xydGYxXGFuc2kKVGhpcyBpcyB0aGUgY29udGVudCBvZiBhIFJURiBmaWxlClxwYXIgfQ=="
}