> ## 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 Server Stage

export const schema = {
  "type": "object",
  "title": "Apache Tika Server (Deprecated) ",
  "description": "A simplified Apache Tika parser more geared towards an Enterprise Search crawl where all documents are parsed by sending them to a Tika Server. Files will be sent to the tika-server service for parsing, which greatly lessens the amount of memory needed on Connector pods. This stage is deprecated. Use 'Apache Tika Container Parser' instead. This stage doesn't work with async-parsing.",
  "required": ["type"],
  "properties": {
    "id": {
      "type": "string",
      "title": "Parser ID",
      "default": "fadea556-ed79-47ae-9343-cdf9676dbd3c"
    },
    "label": {
      "type": "string",
      "title": "Label",
      "description": "A label for this Parser Stage",
      "maxLength": 255
    },
    "enabled": {
      "type": "boolean",
      "title": "Enable this Parser Stage",
      "default": true
    },
    "mediaTypes": {
      "type": "array",
      "title": "Media Types to match",
      "description": "Documents with a media type on this list will be matched by this parser stage. See inheritMediaTypes / use default media types for more.",
      "items": {
        "type": "string",
        "pattern": "^[^\\/]+\\/[^\\/]+$",
        "format": "rfc2646"
      }
    },
    "inheritMediaTypes": {
      "type": "boolean",
      "title": "Match default media types in this Parser Stage",
      "description": "Each parser stage has a built-in list of media types it handles by default. If this setting is true, that list will be used along with any optional additional types provided in the mediaTypes list. If this setting is false, this stage will only be selected for media types in the mediaTypes list, and the mediaTypes list becomes a mandatory property which must have at least one valid media type.",
      "default": true
    },
    "ignoredMediaTypes": {
      "type": "array",
      "title": "Media Types to ignore",
      "description": "Documents with a media type on this list will be not be processed by this parser stage.",
      "items": {
        "type": "string",
        "pattern": "^[^\\/]+\\/[^\\/]+$",
        "format": "rfc2646"
      }
    },
    "pathPatterns": {
      "type": "array",
      "title": "File names to parse",
      "description": "Specify a file name or pattern that must be matched for this parser stage to run. Forward slashes (\"/\") are used to join names of files inside archives with the archive name.",
      "items": {
        "type": "object",
        "properties": {
          "syntax": {
            "type": "string",
            "title": "Pattern type",
            "description": "glob uses bash shell-style wildcards; regex uses Java (PCRE-style) regex",
            "enum": ["glob", "regex"],
            "default": "glob"
          },
          "pattern": {
            "type": "string",
            "title": "File name or pattern",
            "description": "e.g.: \"z.txt\" or \"*.md\" or \"/a/*/b/f.txt\" for glob; \"z.txt$\" or \".*\\.txt$\" or \"^/a/[^\\/]*/b/f.txt$\" for regex"
          }
        }
      }
    },
    "errorHandling": {
      "type": "string",
      "title": "Error Handling",
      "enum": ["ignore", "log", "fail", "mark"],
      "default": "mark"
    },
    "outputFieldPrefix": {
      "type": "string",
      "title": "Prefix parsed fields with",
      "description": "Fields extracted by this parser will be prefixed with this string. The remainder of the field name will be as detected in the stream",
      "maxLength": 20,
      "pattern": "^$|^[A-Za-z_][A-Za-z0-9_\\-\\.]+$"
    },
    "customTikaServerEndpoints": {
      "type": "array",
      "title": "Custom tika server endpoints",
      "description": "Optional - If you do not want to use the Fusion's default http://tikaserver service, you can instead specify one or more alternative tika server URLs.",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "excludeContentTypes": {
      "type": "array",
      "title": "Content types to exclude",
      "description": "List of content types to exclude from parsing",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "addOriginalContent": {
      "type": "boolean",
      "title": "Add original document content (raw bytes)",
      "default": false
    },
    "addFailedDocs": {
      "type": "boolean",
      "title": "Add failed documents",
      "default": false
    },
    "includeImages": {
      "type": "boolean",
      "title": "Include images",
      "default": false
    },
    "contentEncoding": {
      "type": "string",
      "title": "Content transport encoding of the content (per RFC1341)",
      "enum": ["binary", "base64"],
      "default": "binary"
    },
    "maxBytesReturned": {
      "type": "integer",
      "title": "Max bytes returned",
      "description": "Sets the maximum amount of bytes that can be returned from the parser.",
      "default": 100000000
    },
    "maxMetadataFieldBytes": {
      "type": "integer",
      "title": "Max metadata field bytes",
      "description": "Sets the maximum amount of bytes that can be stored in each field.",
      "default": 30000
    },
    "maxEmbeddedDocuments": {
      "type": "integer",
      "title": "Max embedded documents",
      "description": "The maximum number of embedded documents to parse. Any additional embedded documents past this number will be ignored. If set to -1, it will parse an unlimited. If parse is set to 1, no embedded docs will be parsed. If set to 0, the parser will parse nothing.",
      "default": -1
    },
    "parseTimeoutMs": {
      "type": "integer",
      "title": "Parse timeout (ms)",
      "description": "The maximum amount of time in milliseconds that a single parse can take.",
      "default": 15000
    },
    "cleanNonAsciiText": {
      "type": "boolean",
      "title": "Remove all non-ascii text",
      "default": false
    },
    "tikaServerClientMaxRetries": {
      "type": "integer",
      "title": "Tika server client max retries",
      "description": "Sets the max number of retries to perform. -1 indicates to retry forever",
      "default": 2
    },
    "tikaServerClientBackOffDelayMs": {
      "type": "integer",
      "title": "Tika server client backoff delay (ms)",
      "description": "Sets the delay between retries, exponentially backing off to the max delay and multiplying\n successive delays by the delay factor",
      "default": 1000
    },
    "tikaServerClientBackOffMaxDelayMs": {
      "type": "integer",
      "title": "Tika server client max backoff delay (ms)",
      "description": "Sets maximum delay that can be reached while backing off during retries",
      "default": 60000
    },
    "tikaServerClientBackOffDelayFactor": {
      "type": "number",
      "title": "Tika server client max backoff delay factor",
      "description": "Successive delays are multiplied by this factor while retrying",
      "default": 2
    },
    "tikaServerClientRetryMaxDurationMs": {
      "type": "integer",
      "title": "Tika server client retry max duration (ms)",
      "description": "Sets the max duration to perform retries for, else the execution will be failed",
      "default": 120000
    },
    "type": {
      "type": "string",
      "enum": ["tikaserver"],
      "default": "tikaserver"
    }
  },
  "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 formatDescription = str => {
    const s = sanitize(str);
    return (/[.!?]\)*$/).test(s) ? s : `${s}.`;
  };
  const {description, properties = {}, required: requiredProps = []} = schema;
  const visibleProps = useMemo(() => Object.entries(properties).filter(([, prop]) => !prop.hints?.includes("hidden")), [properties]);
  return <div>
      {description && <p>{formatDescription(description)}</p>}

      {visibleProps.map(([name, prop]) => {
    const isRequired = requiredProps.includes(name);
    const hasDefault = prop.default !== undefined;
    const rawDefault = prop.default;
    const isComplexDefault = hasDefault && (typeof rawDefault === "object" || typeof rawDefault === "string" && (rawDefault.length > 20 || rawDefault.includes('"')));
    const fieldProps = {
      key: name,
      body: prop.title || name,
      type: prop.type,
      ...prop.title && ({
        post: [<><span className="text-stone-400 dark:text-stone-500">API property: </span>{name}</>]
      }),
      ...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>{formatDescription(prop.description)}</p>}

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

            {isArrayOfObjects && <div className="flex">
              <p>
                <strong>Object attributes:</strong>
              </p>
              <pre className="!my-0">
                <code>
                  {'{\n'}
                  {Object.entries(prop.items.properties).map(([iname, iprop]) => <>
                      {`  ${iname}`}
                      {prop.items?.required?.includes(iname) && <span style={{
      color: 'red'
    }}> required</span>}
                      {`: {\n    display name: ${sanitize(iprop.title || '')}\n    type: ${iprop.type}\n  }\n`}
                    </>)}
                  {'}'}
                </code>
              </pre>
              </div>}

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

[localhost link]: http://localhost:3000/docs/5/fusion/reference/config-ref/parser-stages/apache-tika-server

[mintlify link]: https://doc.lucidworks.com/docs/5/fusion/reference/config-ref/parser-stages/apache-tika-server

[old doc.lw link]: https://doc.lucidworks.com/fusion/5.9/khf5gb

<Tip>
  **Important**
  import { LwTemplate } from '/snippets/LwTemplate.jsx';

  <LwTemplate />

  This stage is deprecated in Fusion 5.8.x and removed in Fusion 5.9.12.
  Use the [Apache Tika Container parser](/docs/5/fusion/reference/config-ref/parser-stages/apache-tika-container) instead.
</Tip>

Apache Tika Server is a versatile parser that supports parsing many document formats.

This stage is not compatible with asynchronous Tika parsing.

<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>

<SchemaParamFields schema={schema} />
