Apache Tika Parse

Apache Tika Parse

Certified

Parse files with Apache Tika

Auto-detects MIME type, extracts text and metadata, and can capture embedded files. Defaults to XHTML content, no OCR, and stores the parsed Ion payload to internal storage unless store is false. OCR on images requires Tesseract to be installed on the Kestra host; without it, image parsing falls back to metadata extraction only.

yaml
type: io.kestra.plugin.tika.Parse

Extract text and embedded files from an upload.

yaml
id: tika_parse_file
namespace: company.team

inputs:
  - id: file
    type: FILE

tasks:
  - id: parse
    type: io.kestra.plugin.tika.Parse
    from: "{{ inputs.file }}"
    extractEmbedded: true
    store: false

  - id: log_embedded
    type: io.kestra.plugin.core.log.Log
    message: "{{ outputs.parse.result.embedded }}"

Extract text from an image using OCR (requires Tesseract on the Kestra host).

yaml
id: tika_parse_image_ocr
namespace: company.team

inputs:
  - id: file
    type: FILE

tasks:
  - id: parse
    type: io.kestra.plugin.tika.Parse
    from: "{{ inputs.file }}"
    ocrOptions:
      strategy: OCR_AND_TEXT_EXTRACTION
    store: true

Download and extract image metadata using Apache Tika.

yaml
id: parse-image-metadata-using-apache-tika
namespace: company.team

tasks:
  - id: get_image
    type: io.kestra.plugin.core.http.Download
    uri: https://kestra.io/cdn-cgi/image/onerror=redirect,width=1080,height=608,fit=cover,format=webp/_astro/main.C_OjFrVt.jpg

  - id: tika
    type: io.kestra.plugin.tika.Parse
    from: "{{ outputs.get_image.uri }}"
    store: false
    contentType: TEXT
    ocrOptions:
      strategy: OCR_AND_TEXT_EXTRACTION

  - id: log_metadata
    type: io.kestra.plugin.core.log.Log
    message: "{{ outputs.tika.result.metadata }}"

Download a PDF file and extract text from it using Apache Tika.

yaml
id: parse-pdf
namespace: company.team

tasks:
  - id: download_pdf
    type: io.kestra.plugin.core.http.Download
    uri: https://huggingface.co/datasets/kestra/datasets/resolve/main/pdf/app_store.pdf

  - id: parse_text
    type: io.kestra.plugin.tika.Parse
    from: "{{ outputs.download_pdf.uri }}"
    contentType: TEXT
    store: false

  - id: log_extracted_text
    type: io.kestra.plugin.core.log.Log
    message: "{{ outputs.parse_text.result.content }}"
Properties

Character write limit

Maximum characters when writing TEXT content; -1 (default) disables the limit.

DefaultXHTML
Possible Values
TEXTXHTMLXHTML_NO_HEADER

Output content format

Choose TEXT, XHTML (default), or XHTML_NO_HEADER. charactersLimit applies only to TEXT.

Defaultfalse

Extract embedded files

If true, inline/embedded resources are saved to internal storage and returned in embedded; default is false.

Source file to parse

Internal storage URI (e.g. kestra://...).

Default{ "strategy": "NO_OCR" }

Custom OCR options

OCR options for image parsing. To extract text from images, Tesseract must be installed on the Kestra host (apt-get install tesseract-ocr). Without Tesseract, images are parsed with ImageParser and only metadata is returned regardless of the strategy. Default strategy is NO_OCR.

Definitions
enableImagePreprocessingbooleanstring

Enable image preprocessing

Apache Tika will run preprocessing of images (rotation detection and image normalizing with ImageMagick) before sending the image to Tesseract if the user has included dependencies (listed below) and if the user opts to include these preprocessing steps.

languagestring

Language used for OCR

Tesseract language code (e.g. eng, fra).

strategystring
DefaultNO_OCR
Possible Values
AUTONO_OCROCR_ONLYOCR_AND_TEXT_EXTRACTION

OCR strategy

Requires Tesseract and language packs. Default is NO_OCR; use OCR_AND_TEXT_EXTRACTION to merge OCR and text extraction.

Reference (ref) of the pluginDefaults to apply to this task.

Defaulttrue

Store parsed payload to internal storage

When true (default), writes the parsed Ion file to internal storage and returns its URI; when false, emits the result inline.

Parsed result with extracted text and metadata

Definitions
contentstring
embeddedobject
SubTypestring
metadataobject
Formaturi

URI of the extracted content in Kestra's internal storage