MetadataDateCondition
Met when a metadata field has a date value satisfying a comparison, such as a last modification date.
Notes
Met when at least one value of at least one field whose name matches fieldMatcher is a date satisfying the comparison. A missing field or a value that is not a date in the expected format is never a match.
Use one value matcher to compare with a date, or two to define a range (both must be satisfied). With none, the condition is met when the value is a date.
A matcher date is either absolute (2025-05-31 or 2025-05-31T22:44:15) or relative to the current date: TODAY or NOW, optionally followed by a number of units to add or remove, such as TODAY-2Y (Y year, M month, D day, h hour, m minute, s second).
Examples
Not modified since the start of 2024:
- YAML
- JSON
- XML
class: MetadataDateCondition
fieldMatcher:
pattern: crawler.lastModified
valueMatcher:
operator: lt
date: 2024-01-01
{
"class": "MetadataDateCondition",
"fieldMatcher": {
"pattern": "crawler.lastModified"
},
"valueMatcher": {
"operator": "lt",
"date": "2024-01-01"
}
}
<class>MetadataDateCondition</class>
<fieldMatcher>
<pattern>crawler.lastModified</pattern>
</fieldMatcher>
<valueMatcher>
<operator>lt</operator>
<date>2024-01-01</date>
</valueMatcher>
Usage
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
class: MetadataDateCondition
docZoneId: string
fieldMatcher:
ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
format: string
valueMatcher:
date: string
operator: gt
zoneId: string
valueMatcherRangeEnd:
date: string
operator: gt
zoneId: string
{
"class": "MetadataDateCondition",
"docZoneId": "string",
"fieldMatcher": {
"ignoreCase": false,
"ignoreDiacritic": false,
"matchEmpty": false,
"method": "BASIC",
"negateMatches": false,
"partial": false,
"pattern": "string",
"replaceAll": false,
"trim": false
},
"format": "string",
"valueMatcher": {
"date": "string",
"operator": "gt",
"zoneId": "string"
},
"valueMatcherRangeEnd": {
"date": "string",
"operator": "gt",
"zoneId": "string"
}
}
<condition>
<class>MetadataDateCondition</class>
<docZoneId>string</docZoneId>
<fieldMatcher>
<ignoreCase>false</ignoreCase>
<ignoreDiacritic>false</ignoreDiacritic>
<matchEmpty>false</matchEmpty>
<method>BASIC</method>
<negateMatches>false</negateMatches>
<partial>false</partial>
<pattern>string</pattern>
<replaceAll>false</replaceAll>
<trim>false</trim>
</fieldMatcher>
<format>string</format>
<valueMatcher>
<date>string</date>
<operator>gt</operator>
<zoneId>string</zoneId>
</valueMatcher>
<valueMatcherRangeEnd>
<date>string</date>
<operator>gt</operator>
<zoneId>string</zoneId>
</valueMatcherRangeEnd>
</condition>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
docZoneId | string | No | - |
fieldMatcher | TextMatcher | No | TextMatcher |
format | string | No | - |
valueMatcher | DateValueMatcher | No | - |
valueMatcherRangeEnd | DateValueMatcher | No | - |
Property Details
docZoneId
Time zone assumed for field values that do not carry one. Defaults to UTC.
fieldMatcher
Matches metadata field names. Required.
format
The format of the field date values, as per Java DateTimeFormatter. Defaults to the number of milliseconds since 1970-01-01 (epoch). For HTTP headers such as Last-Modified, use EEE, dd MMM yyyy HH:mm:ss zzz.
valueMatcher
The comparison to satisfy: an operator (gt, ge, lt, le or eq, with the same alternative spellings as for numbers), a date expression and an optional zoneId.
valueMatcherRangeEnd
A second comparison that must also be satisfied, to define a range together with valueMatcher.