SearchDocumentIndexedPayload search.document.indexed@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.indexed.v1.json
search.document.indexed v1 (OpenVibe.Search server/store.js announce). An applied index document (from an owner's *.index_document.upserted or the direct API) is servable: restricted (ACL only) or public. Sent on every applied revision that stays exposed, first time or not. 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 |
| |
exposure | enum | yes |
| |
reindexed | boolean | yes | true when Search already held an earlier revision of the document. | |
canonical_url | string | null | yes | Only when the document is public (public_unlisted or public_listed); null otherwise or when it has none. |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: public-wiki-page
{
"owner": "wiki",
"type": "page",
"id": "pg_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"revision": 7,
"exposure": "public_listed",
"reindexed": true,
"canonical_url": "https://openvibe.wiki/wiki/Main_Page"
}Valid: restricted-item
{
"owner": "sources",
"type": "item",
"id": "itm_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"revision": 1,
"exposure": "restricted",
"reindexed": false,
"canonical_url": null
}Rejected: exposure-none
{
"owner": "wiki",
"type": "page",
"id": "pg_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"revision": 7,
"exposure": "none",
"reindexed": true,
"canonical_url": null
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('search.document.indexed@1', value); // { valid, errors: [{ path, message }] }