ingest-attachment.asciidoc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. [[ingest-attachment]]
  2. === Ingest Attachment Processor Plugin
  3. The ingest attachment plugin lets Elasticsearch extract file attachments in common formats (such as PPT, XLS, and PDF) by
  4. using the Apache text extraction library http://lucene.apache.org/tika/[Tika].
  5. You can use the ingest attachment plugin as a replacement for the mapper attachment plugin.
  6. The source field must be a base64 encoded binary. If you do not want to incur
  7. the overhead of converting back and forth between base64, you can use the CBOR
  8. format instead of JSON and specify the field as a bytes array instead of a string
  9. representation. The processor will skip the base64 decoding then.
  10. [[ingest-attachment-options]]
  11. .Attachment options
  12. [options="header"]
  13. |======
  14. | Name | Required | Default | Description
  15. | `field` | yes | - | The field to get the base64 encoded field from
  16. | `target_field` | no | attachment | The field that will hold the attachment information
  17. | `indexed_chars` | no | 100000 | The number of chars being used for extraction to prevent huge fields. Use `-1` for no limit.
  18. | `properties` | no | all | Properties to select to be stored. Can be `content`, `title`, `name`, `author`, `keywords`, `date`, `content_type`, `content_length`, `language`
  19. |======
  20. [source,js]
  21. --------------------------------------------------
  22. {
  23. "description" : "...",
  24. "processors" : [
  25. {
  26. "attachment" : {
  27. "field" : "data"
  28. }
  29. }
  30. ]
  31. }
  32. --------------------------------------------------
  33. NOTE: Extracting contents from binary data is a resource intensive operation and
  34. consumes a lot of resources. It is highly recommended to run pipelines
  35. using this processor in a dedicated ingest node.