FieldReportTransformer
Generates CSV reports of discovered fields.
Notes
This utility creates a CSV file listing the fields identified during a crawl session, capturing them at your chosen stage of the importing process. To ensure all discovered fields are included, use this class as a post-parse handler before applying any field filtering.
The report will list one field per row, along with a few sample values (3 by default). The samples will be the first ones encountered.
This handler does not impact the data being imported at all (it only reads it). It also do not store the "content" as a field.
When file is not specified, a file called field-report.csv is created in the working directory.
Can be used both as a pre-parse or post-parse handler.
Examples
The following example logs all discovered fields into a field-report.csv file, along with only 1 example value.
- YAML
- JSON
- XML
handler:
class: ExternalTransformer
file: C:\reports\field-report.csv
maxSamples: 1
{
"handler": {
"class": "ExternalTransformer",
"file": "C:\\reports\\field-report.csv",
"maxSamples": 1
}
}
<handler>
<class>ExternalTransformer</class>
<file>C:\reports\field-report.csv</file>
<maxSamples>1</maxSamples>
</handler>
Usage
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
class: FieldReportTransformer
file: string
label: string
maxSamples: 0
truncateSamplesAt: 0
withHeaders: false
withOccurences: false
{
"class": "FieldReportTransformer",
"file": "string",
"label": "string",
"maxSamples": 0,
"truncateSamplesAt": 0,
"withHeaders": false,
"withOccurences": false
}
<handler>
<class>FieldReportTransformer</class>
<file>string</file>
<label>string</label>
<maxSamples>0</maxSamples>
<truncateSamplesAt>0</truncateSamplesAt>
<withHeaders>false</withHeaders>
<withOccurences>false</withOccurences>
</handler>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
file | string | No | - |
label | string | No | - |
maxSamples | integer | No | 3 |
truncateSamplesAt | integer | No | -1 |
withHeaders | boolean | No | false |
withOccurences | boolean | No | false |
Property Details
file
Specifies the output file path where the generated report is saved.
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.
maxSamples
Limits the maximum number of field samples included in the report.
truncateSamplesAt
Sets the character limit for truncating field samples in the report.
withHeaders
Determines whether the report includes headers for easier readability.
withOccurences
Indicates whether to include the count of occurrences for each field value.