# oarepo\_oaipmh\_harvester.oai\_record.dumpers

## `oarepo_oaipmh_harvester.oai_record.dumpers`

Dumpers for OAI harvested records.

### `MAX_KEYWORD_LENGTH = 512`

`ignore_above` of the `errors.*` keyword fields - longer values are not indexed.

### `AddHarvesterDumperExt`

Bases: `SearchDumperExt`

Dumper extension adding the harvester's name and managers to the search document.

#### `dump(record: Any, data: dict[str, Any]) -> None`

Add the harvester name and managers to the dumped data.

#### `load(data: dict[str, Any], record_cls: type) -> None`

Load the data.

Reverse the changes made by the dump method.

### `ErrorsFacetDumperExt`

Bases: `SearchDumperExt`

Make the errors of the search document usable in facets.

The `errors.*` fields are keywords with `ignore_above: 512` - a longer message or a traceback in `location` would not be indexed at all, so the record would be missing in the error facets. The search document gets single-line messages truncated to fit, the innermost traceback frame as the location and a placeholder for an empty message; the database keeps the full errors (shown in the harvest record detail).

#### `dump(record: Any, data: dict[str, Any]) -> None`

Shorten the errors of the search document.

#### `load(data: dict[str, Any], record_cls: type) -> None`

Keep the shortened errors - the full ones are only in the database.
