Skip to main content

DefaultParser

Generic document parser for raw content passthrough or text decoding

Notes​

It uses Apache Tika for most of its supported content types. For unknown content types, it falls back to Tika's generic media detector/parser.

Built-in baseline, not a hard limit

The format coverage described for DefaultParser reflects built-in importer capabilities in Norconex Crawler. It is a practical baseline, not a fixed ceiling. Teams can extend parser behavior and pipeline logic for customer-specific formats and extraction requirements.

Three optional features hang off this parser, each with its own settings page: embedded for documents inside documents, ocr for text inside images, and grobid for scientific papers.

Examples​

Saves documents that fail to parse into a directory for inspection.

handler:
class: DefaultParser
poolSize: 2
xmlParserPoolSize: 16
errorsSaveDir: C:\reports\errors

Uses Tesseract to read English text out of the images inside PDFs.

handler:
class: DefaultParser
ocr:
tesseractPath: /app/ocr/tesseract
contentTypeMatcher:
method: BASIC
pattern: application/pdf
ignoreCase: true
language: eng

Splits the contents of ZIP files into individual documents, skips images embedded in any container, and leaves the contents of Word documents alone while still processing the Word document itself.

handler:
class: DefaultParser
embedded:
splitContentTypes:
- method: BASIC
pattern: application/zip
ignoreCase: true
skipEmbeddedContentTypes:
- method: REGEX
pattern: image/.*
ignoreCase: true
skipEmbeddedOfContentTypes:
- method: BASIC
pattern: application/msword
ignoreCase: true

Usage​

Full configuration skeleton, with every option and its default
class: DefaultParser
embedded:
discardContainerContentTypes:
- {}
maxEmbeddedDepth: 0
skipEmbeddedContentTypes:
- {}
skipEmbeddedOfContentTypes:
- {}
splitContentTypes:
- {}
errorsSaveDir: string
grobid:
enabled: false
serviceUrl: string
label: string
ocr:
applyRotation: false
colorSpace: string
contentTypeMatcher:
ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
density: 0
depth: 0
disabled: false
enableImagePreprocessing: false
filter: string
imageMagickPath: string
language: string
maxFileSizeToOcr: 0
minFileSizeToOcr: 0
pageSegMode: string
pageSeparator: string
preserveInterwordSpacing: false
resize: 0
skipOcr: false
tessdataPath: string
tesseractPath: string
timeoutSeconds: 0
poolSize: 0
xmlParserPoolSize: 0

Properties​

PropertyTypeRequiredDefault
embeddedEmbeddedConfigNoEmbeddedConfig
errorsSaveDirstringNo-
grobidGrobidConfigNoGrobidConfig
labelstringNo-
ocrOcrConfigNoOcrConfig
poolSizeintegerNo0
xmlParserPoolSizeintegerNo-

Property Details​

embedded​

How documents contained inside other documents are handled — the files in a zip, the attachments on an email, the images in a PDF. By default their content and metadata are merged into the containing document.

Set splitContentTypes to have a container's embedded documents become documents in their own right, each going through the whole import cycle. Set skipEmbeddedContentTypes or skipEmbeddedOfContentTypes to leave some of them unparsed. See EmbeddedConfig.

errorsSaveDir​

Directory where documents that fail to parse are copied, for inspection. Left unset, failures are logged but the document is not kept.

grobid​

Optional Grobid service settings, for extracting structured metadata and text from scientific documents such as journal article PDFs. Disabled unless you enable it. See GrobidConfig.

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.

ocr​

Optional Tesseract settings, for pulling text out of images and of documents containing images — scanned PDFs, TIFF archives, screenshots. Tesseract is not bundled: install it separately and point ocr.tesseractPath at it, and OCR stays inactive until you do.

Once active, OCR is attempted on every supported image format (TIFF, PNG, JPEG, GIF, BMP, and images embedded in documents). It is slow next to text extraction, so restricting it by content type and file size is usually worth doing. All settings are described under OcrConfig.

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.

xmlParserPoolSize​

Optional positive size of Tika's pool of reusable SAX parsers and DOM builders, used to parse XML-based formats (HTML, XHTML, Office Open XML, ...). Omitting the setting leaves Tika's size as it is, 10 by default. When more documents than that are parsed at once, Tika logs "Contention waiting for a SAXParser" and builds a throwaway parser for each extra document, so a crawl using more threads than the pool size gains from setting it to at least its number of threads.

The pool is shared by the whole JVM, and the largest size any handler asks for wins: the first explicit size is applied as is, later ones can only make it larger. This setting is independent of poolSize.