> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Apache Tika

> Parser stage configuration specifications

export const schema = {
  "type": "object",
  "title": "Apache Tika (Deprecated) ",
  "description": "Parses a wide variety of document formats including Microsoft Office (PPT, DOCX, XLSX), PDF, HTML, and images using Apache Tika in-process. Deprecated: this parser runs Tika in the same JVM as the connector, which can cause memory leaks and stability issues. Use the Apache Tika Container Parser instead for better isolation and reliability.",
  "required": ["type"],
  "properties": {
    "id": {
      "type": "string",
      "title": "Parser ID",
      "default": "aac63171-350a-4afe-bcec-73059bed630d"
    },
    "label": {
      "type": "string",
      "title": "Label",
      "description": "Human-readable identifier displayed in the Fusion Admin UI, monitoring dashboards, and log messages. Use descriptive labels like `Parse Product PDFs` to aid debugging and team collaboration. Labels appear in performance metrics and error reports, making it easier to identify which stage failed.",
      "maxLength": 255
    },
    "enabled": {
      "type": "boolean",
      "title": "Enable this Parser Stage",
      "default": true,
      "description": "Controls whether this parser stage is active and available for use. When `false`, the stage is completely inactive regardless of other settings. When `true`, the stage runs according to its other configuration options."
    },
    "mediaTypes": {
      "type": "array",
      "title": "Media Types to match",
      "description": "Specifies the media types this parser stage handles. Documents with a matching media type are routed to this stage for parsing. See `inheritMediaTypes` to combine this list with the stage's built-in defaults.",
      "items": {
        "type": "string",
        "pattern": "^[^\\/]+\\/[^\\/]+$",
        "format": "rfc2646"
      }
    },
    "inheritMediaTypes": {
      "type": "boolean",
      "title": "Match default media types in this Parser Stage",
      "description": "Controls whether this stage combines its built-in default media types with those in `mediaTypes`. When `true`, both lists are merged. When `false`, only the `mediaTypes` list is used and must contain at least one entry. Set to `false` to override the default media types entirely.",
      "default": true
    },
    "ignoredMediaTypes": {
      "type": "array",
      "title": "Media Types to ignore",
      "description": "Specifies media types this parser stage excludes from processing. Documents matching an ignored media type are skipped even if they match `mediaTypes`. Use this to carve out exceptions from a broadly matched media type set.",
      "items": {
        "type": "string",
        "pattern": "^[^\\/]+\\/[^\\/]+$",
        "format": "rfc2646"
      }
    },
    "pathPatterns": {
      "type": "array",
      "title": "File names to parse",
      "description": "Restricts this parser stage to files whose names match the specified pattern. Use forward slashes (`/`) to join archive names with entry names when matching files inside archives. If no pattern is specified, the stage applies to all matching media types.",
      "items": {
        "type": "object",
        "properties": {
          "syntax": {
            "type": "string",
            "title": "Pattern type",
            "description": "glob uses bash shell-style wildcards and regex uses Java (PCRE-style) regex.",
            "enum": ["glob", "regex"],
            "default": "glob"
          },
          "pattern": {
            "type": "string",
            "title": "File name or pattern",
            "description": "glob examples are \"z.txt\" or \"*.md\" or \"/a/*/b/f.txt\". regex examples are \"z.txt$\" or \".*\\.txt$\" or \"^/a/[^\\/]*/b/f.txt$\"."
          }
        }
      }
    },
    "errorHandling": {
      "type": "string",
      "title": "Error Handling",
      "enum": ["ignore", "log", "fail", "mark"],
      "default": "mark"
    },
    "outputFieldPrefix": {
      "type": "string",
      "title": "Prefix parsed fields with",
      "description": "Sets a string prefix applied to all fields extracted by this parser, useful for namespacing or avoiding field name collisions. For example, `tika_` produces fields like `tika_title` and `tika_author`. Leave empty to apply no prefix.",
      "maxLength": 20,
      "pattern": "^$|^[A-Za-z_][A-Za-z0-9_\\-\\.]+$"
    },
    "includeImages": {
      "type": "boolean",
      "title": "Include images",
      "default": false
    },
    "flattenCompound": {
      "type": "boolean",
      "title": "Flatten compound documents",
      "default": false
    },
    "addFailedDocs": {
      "type": "boolean",
      "title": "Add failed documents",
      "default": false
    },
    "addOriginalContent": {
      "type": "boolean",
      "title": "Add original document content (raw bytes)",
      "default": false
    },
    "contentEncoding": {
      "type": "string",
      "title": "Content transport encoding of the content (per RFC1341)",
      "enum": ["binary", "base64"],
      "default": "binary"
    },
    "returnXml": {
      "type": "boolean",
      "title": "Return parsed content as XML",
      "default": false
    },
    "keepOriginalStructure": {
      "type": "boolean",
      "title": "Return original XML and HTML instead of Tika XML output (only applies if 'Return parsed content as XML is true')",
      "default": false,
      "description": "Preserves the original document structure in the parsed output rather than flattening nested fields. Refer to the stage documentation for format-specific behavior and valid values."
    },
    "extractHtmlLinks": {
      "type": "boolean",
      "title": "Extract XHTML links",
      "description": "Extracts hyperlinks explicitly embedded in the document structure, such as HTML `<a>` tags, PDF annotations, and Word hyperlinks. When enabled, collected URLs are available for downstream processing like web crawling or link analysis. Applies to formats that support link structures including HTML, PDF, and Office documents.",
      "default": true
    },
    "extractOtherLinks": {
      "type": "boolean",
      "title": "Extract other links",
      "description": "Uses regular expression heuristics to find and extract URLs from plain text content throughout the document, including body text, metadata, and comments. When enabled, identifies web URLs and email addresses that are not formally marked up as links. When disabled, only structured links declared in the document format are extracted.",
      "default": false
    },
    "excludeContentTypes": {
      "type": "array",
      "title": "Content types to exclude",
      "description": "Specifies MIME content types this stage excludes from parsing. Documents matching these types are skipped even if they otherwise match `mediaTypes`. Use this to block specific formats within a broad media type pattern.",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "zipBombCompressionRatio": {
      "type": "integer",
      "title": "Maximum input-to-output byte ratio",
      "description": "Sets the maximum compression ratio (output bytes ÷ input bytes) before triggering zip bomb protection. Increase this value when indexing legitimately highly compressed files that exceed the default threshold. Protects against maliciously crafted compressed files designed to exhaust system resources when decompressed.",
      "default": 200
    },
    "zipBombMaxDepth": {
      "type": "integer",
      "title": "Maximum nesting depth",
      "description": "Sets the maximum allowed XML element nesting depth before triggering zip bomb detection. Increase this value when indexing legitimately deeply nested XML files such as complex configuration exports. Protects against maliciously crafted XML files designed to cause stack overflow or excessive memory use.",
      "default": 200
    },
    "zipBombMaxPackageEntryDepth": {
      "type": "integer",
      "title": "Maximum package entry depth",
      "description": "Sets the maximum allowed archive nesting depth before triggering zip bomb detection. Increase this value when indexing legitimate deeply nested package structures such as some software distributions. Protects against malicious files with excessive archive nesting designed to exhaust resources.",
      "default": 20
    },
    "type": {
      "type": "string",
      "enum": ["tika"],
      "default": "tika"
    }
  },
  "additionalProperties": false,
  "category": "Other",
  "categoryPriority": 1,
  "unsafe": false
};

export const SchemaParamFields = ({schema}) => {
  const sanitize = str => {
    if (typeof str !== "string") return str;
    return str.replace(/^"(.*)"$/s, "$1").replace(/\\/g, "").replace(/"/g, "'");
  };
  const renderMd = str => {
    const s = sanitize(str);
    const text = (/[.!?]\)*$/).test(s) ? s : `${s}.`;
    return text.split(/(\*\*[^*]+\*\*|_[^_]+_|`[^`]+`)/g).map((part, i) => {
      if (part.startsWith("**")) return <strong key={i}>{part.slice(2, -2)}</strong>;
      if (part.startsWith("_")) return <em key={i}>{part.slice(1, -1)}</em>;
      if (part.startsWith("`")) return <code key={i}>{part.slice(1, -1)}</code>;
      return part;
    });
  };
  const {description, properties = {}, required: requiredProps = []} = schema;
  const visibleProps = useMemo(() => Object.entries(properties).filter(([, prop]) => !prop.hints?.includes("hidden")), [properties]);
  const renderProp = ([name, prop]) => {
    const isRequired = requiredProps.includes(name);
    const hasDefault = prop.default !== undefined;
    const rawDefault = prop.default;
    const hints = prop.hints || [];
    const isComplexDefault = hasDefault && (typeof rawDefault === "object" || typeof rawDefault === "string" && (rawDefault.length > 20 || rawDefault.includes('"')));
    const postBadges = [];
    if (prop.title) {
      postBadges.push(<><span className="text-stone-400 dark:text-stone-500">API property: </span>{name}</>);
    }
    const constraints = [];
    if (prop.minimum !== undefined && prop.maximum !== undefined) {
      constraints.push(`Range: ${prop.minimum} – ${prop.maximum}`);
    } else if (prop.minimum !== undefined) {
      constraints.push(`Min: ${prop.minimum}`);
    } else if (prop.maximum !== undefined) {
      constraints.push(`Max: ${prop.maximum}`);
    }
    if (prop.minLength !== undefined && prop.maxLength !== undefined) {
      constraints.push(`Length: ${prop.minLength} – ${prop.maxLength}`);
    } else if (prop.minLength !== undefined) {
      constraints.push(`Min length: ${prop.minLength}`);
    } else if (prop.maxLength !== undefined) {
      constraints.push(`Max length: ${prop.maxLength}`);
    }
    const fieldProps = {
      key: name,
      body: prop.title || name,
      type: prop.type,
      ...postBadges.length > 0 && ({
        post: postBadges
      }),
      ...isRequired && ({
        required: true
      }),
      ...!isComplexDefault && hasDefault ? {
        default: sanitize(String(rawDefault))
      } : {}
    };
    const isObject = prop.type === "object" && prop.properties;
    const isArrayOfObjects = prop.type === "array" && prop.items?.type === "object" && prop.items.properties;
    return <ParamField {...fieldProps}>
        {prop.description && <p>{renderMd(prop.description)}</p>}

        {prop.enum && <p>
            Allowed values: 
            {prop.enum.map((v, i) => <>{i > 0 && ", "}<code key={i}>{String(v)}</code></>)}
          </p>}

        {constraints.length > 0 && <p className="text-stone-500 dark:text-stone-400 text-sm">
            {constraints.join(" · ")}
          </p>}

        {isComplexDefault && <div className="flex">
            <p>
              <strong>Default:</strong>
            </p>
            <pre className="!my-0">
              <code>
                {JSON.stringify(rawDefault, null, 2)}
              </code>
            </pre>
          </div>}

        {isArrayOfObjects && <Expandable title="item properties">
            <SchemaParamFields schema={{
      properties: prop.items.properties,
      required: prop.items.required
    }} />
          </Expandable>}

        {isObject && <Expandable title="properties">
            <SchemaParamFields schema={{
      properties: prop.properties,
      required: prop.required
    }} />
          </Expandable>}
      </ParamField>;
  };
  return <div>
      {description && <p>{renderMd(description)}</p>}

      {visibleProps.map(renderProp)}
    </div>;
};

[localhost link]: http://localhost:3000/docs/lucidworks-search/09-developer-documentation/config-specs/parsers/apache-tika-parser

[mintlify link]: https://doc.lucidworks.com/docs/lucidworks-search/09-developer-documentation/config-specs/parsers/apache-tika-parser

[old doc.lw link]: https://doc.lucidworks.com/managed-fusion/5.9/l6hig6

<Note>
  **Deprecation and removal notice**
  import { LwTemplate } from '/snippets/LwTemplate.jsx';

  <LwTemplate />

  This parser is deprecated as of Lucidworks Search 5.8.0 and is expected to be removed in a later version. Use the asynchronous Tika parsing method instead. For more information, see [Asynchronous Tika Parsing](/docs/lucidworks-search/04-move-data-in/parsers/asynchronous-tika-parsing).
</Note>

Apache Tika is a versatile parser that supports many types of unstructured document formats, such as HTML, PDF, Microsoft Office, OpenOffice, RTF, audio, video, images, and more. A complete list of supported formats is available at [Apache Tika](http://tika.apache.org/).

This stage is not compatible with asynchronous Tika parsing.

<Note>
  **Important**

  To perform image text extraction when **Include images** is enabled, contact your Lucidworks representative for details.
</Note>

<Tip>
  When entering configuration values in the UI, use *unescaped* characters, such as `\t` for the tab character. When entering configuration values in the API, use *escaped* characters, such as `\\t` for the tab character.
</Tip>

Parse Office documents (ppt/docx/pdf), HTML files, images (jpeg/tiff), and more. See "Supported Formats" at [https://tika.apache.org/](https://tika.apache.org/) for a full list. This stage is deprecated. Use 'Apache Tika Container Parser' instead. This stage doesn't work with async-parsing.

<SchemaParamFields schema={schema} />
