SearchDocumentRemovedPayload search.document.removed@1
Generated at from
openvibe-contracts v0.33.0 and
openvibe-sdk v0.5.0.
- Version
- 1.0.0
- Owner
- search
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-018
- Schema
https://openvibe.network/contracts/events/payloads/search.document.removed.v1.json
search.document.removed v1 (OpenVibe.Search server/store.js announce). A document's exposure went down: deleted, made draft or unpublished, its visibility changed, or it became noindex. Caches and sitemaps purge canonical_url. Envelope: subject { type: document, id: <owner>/<type>/<id>, revision }, visibility internal, priority important, actor service:search, trace_id of the request or event that caused it.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
owner | string | yes |
| |
type | string | yes |
| |
id | string | yes |
| |
revision | integer | yes |
| |
reason | enum | yes |
| |
previous_exposure | enum | yes |
| |
exposure | enum | yes | Lower than previous_exposure. none: no longer served to anyone. |
|
canonical_url | string | null | yes | The URL only when the document was public before (so it must be purged); null otherwise. |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: unpublished
{
"owner": "blog",
"type": "post",
"id": "pst_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"revision": 12,
"reason": "not_published",
"previous_exposure": "public_listed",
"exposure": "none",
"canonical_url": "https://openvibe.blog/alex/hello-world"
}Rejected: unknown-reason
{
"owner": "blog",
"type": "post",
"id": "pst_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"revision": 12,
"reason": "spam",
"previous_exposure": "public_listed",
"exposure": "none",
"canonical_url": null
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('search.document.removed@1', value); // { valid, errors: [{ path, message }] }