TikaParser
Provides direct access to Apache Tika's parsing capabilities
Notes
The importer mostly uses Apache Tika as its default parser to automatically extract textual content and metadata from diverse file types (including PDFs, Microsoft Office documents, images, and HTML). The TikaParser class offers users explicit control over this parsing process, enabling advanced configurations like custom MIME type handling, embedded resource extraction, OCR support, and user-defined Tika configuration files. If direct interaction or detailed customization of Tika parsing is required beyond Norconex’s default settings, users should explicitly configure and use TikaParser.
The parser behavior and format coverage available through TikaParser are a
built-in baseline. They can be extended and customized through parser
configuration and pipeline composition for customer-specific requirements.
Examples
The following example defined a TikaParser with a custom configuration file.
- YAML
- JSON
- XML
handler:
class: TikaParser
poolSize: 2
tikaConfigFile: /path/to/tika-config.json
{
"handler": {
"class": "TikaParser",
"poolSize": 2,
"tikaConfigFile": "/path/to/tika-config.json"
}
}
<handler>
<class>TikaParser</class>
<poolSize>2</poolSize>
<tikaConfigFile>/path/to/tika-config.json</tikaConfigFile>
</handler>
Usage
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
class: TikaParser
label: string
poolSize: 0
tikaConfigFile: string
{
"class": "TikaParser",
"label": "string",
"poolSize": 0,
"tikaConfigFile": "string"
}
<handler>
<class>TikaParser</class>
<label>string</label>
<poolSize>0</poolSize>
<tikaConfigFile>string</tikaConfigFile>
</handler>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
label | string | No | - |
poolSize | integer | No | 0 |
tikaConfigFile | string | No | - |
Property Details
label
An optional, user-supplied label for this step in the importer pipeline. It has no effect on processing — it exists purely to help identify this step, for example in large configurations or in the visual configurator.
poolSize
Maximum number of top-level documents the handler parses at once. The default,
0, sets no limit. Negative values are invalid.
When that many documents are already being parsed, the next one waits for one of them to finish. Embedded documents count as part of their container, so they never wait on it. Closing the handler wakes waiting callers with an error.
For example, "poolSize": 2 allows two parses at once per handler while other
crawler threads fetch documents or run other handlers, which keeps parsing-heavy
documents (large PDFs, OCR) from taking every thread. All documents share the same
Tika parser whatever the size, so a limit costs no memory.
tikaConfigFile
Path to a Tika JSON configuration file, giving you Tika's own parser selection and settings. Tika 4 dropped the XML configuration format used by earlier versions, so an XML file will not load. Without it, Tika's defaults apply.