afs_doc_limit - AFS - Reference Guides

AFS Filters Description

Product
AFS
Platform
7.12
Category
Reference Guides
Language
English
The afs_doc_limit filter is used to check a set of criteria on each received document in order to discard unusually "large" documents (it might be useful to control these criteria if documents are generated). The criteria are:
  • size: to check the size of a given layer. If the document is larger, then it is discarded.,
  • xpaths (applicable for XML content): to check that xpaths do not have too many nodes.

The filter is declared with the afs_doc_limit type. It is in the antidot-paf package. It is a processor filter.

This filter can be instantiated only once at any given moment. It will not read the "instances" parameter in the configuration.

The Document Limit filter specifications are described in the following table:

Parameter name

Mandatory

Type

Default

Description

input_layer

No

layer

CONTENTS

It is the layer to check.

nsmap

No

map

Empty map

It is the namespaces to be used to interpret the xpaths.

size

No

integer

5120

It is the maximum size in Kb

xpaths

No

map

Empty map

It is the xpaths to check, where key is the xpath and value is a number indicating the maximal number of occurrences of this xpath.

Attention: This filter does not test the XML validity of the content. This filter validates the document when the content cannot be parsed as XML, but respects the size threshold. Please use the afs_xml_validation filter before this filter for XML testing.
Note: To test several layers, it is possible to chain several afs_limit filters. The afs_limit filter is designed to only test one layer per filter.