Skip to main content

EmbeddedConfig

Controls how embedded documents within containers are handled during parsing.

Notes​

Controls how the DefaultParser handles embedded documents (such as email attachments or files within ZIP archives). Supports splitting embedded documents into individual documents, skipping embedded documents by content type, and skipping embedded documents based on the container content type.

Usage​

discardContainerContentTypes:
- ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
maxEmbeddedDepth: 0
skipEmbeddedContentTypes:
- ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
skipEmbeddedOfContentTypes:
- ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
splitContentTypes:
- ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false

Properties​

PropertyTypeRequiredDefault
discardContainerContentTypesTextMatcher[]No-
maxEmbeddedDepthintegerNo-1
skipEmbeddedContentTypesTextMatcher[]No-
skipEmbeddedOfContentTypesTextMatcher[]No-
splitContentTypesTextMatcher[]No-

Property Details​

discardContainerContentTypes​

Content types of container files to discard once their embedded documents were split off (see splitContentTypes). A split container is otherwise a document of its own, with whatever content it has itself, and is committed like any other: the body of an email, the text of an office document holding pictures. A zip file has none, so you may not want it. Its embedded documents are not affected: they are documents of their own and carry on.

Only applies to a container whose type is also split, and that held embedded documents. A container that is merged is the one document holding everything and is never discarded, whatever is listed here. Each level is looked at on its own: a split container inside a split container is discarded too when its type is listed. Default is to discard none.

maxEmbeddedDepth​

How deep to follow embedded documents. 0 is the container itself, 1 its immediate attachments, and so on. Default is -1, unlimited. Embedded documents nest — a zip holding an email holding a PDF — so a limit is worth setting when containers are untrusted.

skipEmbeddedContentTypes​

Content types of the embedded documents to leave unparsed, whatever contains them. A common use is skipping the images embedded in office documents, which are numerous and rarely worth extracting.

skipEmbeddedOfContentTypes​

Content types of container files whose embedded documents should not be parsed at all. Use it to ignore the innards of a container type wholesale — the container itself is still processed.

splitContentTypes​

Content types of container files whose embedded documents should become documents in their own right. By default nothing is split: embedded content and metadata are merged into the parent.

Split documents go through the whole import cycle themselves, this parser included, and are returned as a nested tree under the container.