DeleteRejectedEventListener
Sends deletion requests to the committer when documents are rejected or not found.
Notes
Listens for crawler rejection events (such as "not found" or "filtered") and sends a deletion request to the committer for the affected document. Useful for keeping the index clean when documents are removed from or filtered out of the source.
The rejections of reference filters, metadata filters and document filters all name the reference, so any of them can trigger a deletion. To avoid deleting what was never sent, set previouslyProcessedOnly.
Examples
The following example will send deletion requests whenever a reference is not found (e.g., a 404 response from a web server) or if it was filtered out by the crawler.
- YAML
- JSON
- XML
class: DeleteRejectedEventListener
eventMatcher:
method: CSV
pattern: REJECTED_NOTFOUND,REJECTED_FILTER
{
"class": "DeleteRejectedEventListener",
"eventMatcher": {
"method": "CSV",
"pattern": "REJECTED_NOTFOUND,REJECTED_FILTER"
}
}
<class>DeleteRejectedEventListener</class>
<eventMatcher>
<method>CSV</method>
<pattern>REJECTED_NOTFOUND,REJECTED_FILTER</pattern>
</eventMatcher>
Usage
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
class: DeleteRejectedEventListener
eventMatcher:
ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
previouslyProcessedOnly: false
{
"class": "DeleteRejectedEventListener",
"eventMatcher": {
"ignoreCase": false,
"ignoreDiacritic": false,
"matchEmpty": false,
"method": "BASIC",
"negateMatches": false,
"partial": false,
"pattern": "string",
"replaceAll": false,
"trim": false
},
"previouslyProcessedOnly": false
}
<deleteRejectedEventListener>
<class>DeleteRejectedEventListener</class>
<eventMatcher>
<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>
</eventMatcher>
<previouslyProcessedOnly>false</previouslyProcessedOnly>
</deleteRejectedEventListener>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
eventMatcher | TextMatcher | No | TextMatcher |
previouslyProcessedOnly | boolean | No | false |
Property Details
eventMatcher
A text matcher identifying which crawler events trigger a deletion request to the committer. Default matches any event matching the regular expression REJECTED_.*.
previouslyProcessedOnly
When true, a deletion request is only sent for a reference that a previous crawl session processed successfully (new, modified, unmodified or not yet due for a recrawl). A reference that was never processed successfully (it was rejected the first time it was encountered, for instance) was most likely never sent to a committer, and one that a previous session already rejected was already asked for, so neither gets a request. That keeps the number of deletion requests to what is needed, and stops the same ones from being sent run after run. This is read from the previous session's ledger, so nothing is deleted on a first crawl. The ledger does not track what each committer received. Default is false: every rejected reference gets a deletion request.