IndexDocument search.index-document@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/search/index-document.v1.json
What an owning service tells OpenVibe.Search about one of its resources (roadmap §15.12, §4.2 A). The owner stays the source of truth; Search keeps a revision-ordered, permission-aware copy for discovery. A document with deleted=true is a tombstone: it removes the resource from every result and wins over any upsert with the same or an older revision.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
owner | string | yes | Owning service id (wiki, blog, news, community, sources…). Only that service may write the document. |
|
type | string | yes | Resource type inside the owner (page, post, story, entity, offer, coupon, instrument, item…). |
|
id | string | yes | Resource id inside owner+type. Stable across revisions. |
|
revision | integer | yes | Owner's monotonic revision of the resource. An older revision never overwrites a newer one; at equal revision a deletion wins. |
|
deleted | boolean | Deletion marker. true = tombstone; every other content field is ignored. |
| |
visibility | enum | public: anyone. unlisted: never listed except to ACL matches; fetchable by exact id by a signed-in subject. members: subjects, groups or entitlements in acl. private: subjects in acl.subjects only. draft: never served. |
| |
acl | object | Who may see a non-public document. Ignored for public documents. Empty means nobody (for members/private) or direct-id only (for unlisted). |
| |
acl.subjects | array of string |
| ||
acl.groups | array of string | Opaque group keys owned by some service, e.g. role:admin (Network role), wiki.space:spc_…:member. |
| |
acl.entitlements | array of string | Entitlement keys (VIP/Billing), e.g. vip.plan:pln_…. Only a first-party service that just resolved them may present them for a viewer. |
| |
canonical_url | string |
| ||
title | string |
| ||
summary | string |
| ||
body | string | Plain text for full-text search (no HTML). Keep it under the Events payload limit when publishing through Events. |
| |
facets | object | Filterable values (category, tags, space, author subject, currency…). Filter with facet.<key>=<value>. | ||
language | string | BCP 47 tag. |
| |
authorship | enum |
| ||
provenance | array of object | Where the content came from: typed references to source records (Sources items, citations, Media objects). |
| |
provenance[].service | string | yes |
| |
provenance[].type | string | yes |
| |
provenance[].id | string | yes |
| |
provenance[].revision | integer |
| ||
provenance[].label | string |
| ||
provenance[].url | string |
| ||
provenance[].retrieved_at | string |
| ||
provenance[].stub | boolean | true when the reference came from a stub provider; the document is then never indexable. | ||
publication_state | enum | Only published documents are ever served. |
| |
published_at | string | null |
| ||
updated_at | string | null |
| ||
indexability | object | The owner's deterministic indexability decision (publishing packages, roadmap §32.3). Search can only make it stricter. |
| |
indexability.decision | enum | yes |
| |
indexability.reasons | array of string | Known reasons: draft, private, members_only, unlisted, not_published, deleted, thin_content, duplicate_without_canonical, unsupported_claims, unsourced, stub_provider, sensitive_unreviewed, ai_unreviewed, missing_canonical_url, third_party_content, owner_decision. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: tombstone
{
"owner": "blog",
"type": "post",
"id": "post-42",
"revision": 7,
"deleted": true
}Valid: wiki-page
{
"owner": "wiki",
"type": "page",
"id": "pg_01J0000000000000000000000Z",
"revision": 3,
"visibility": "public",
"canonical_url": "https://openvibe.wiki/w/example",
"title": "Example page",
"summary": "A short summary.",
"body": "Plain text body.",
"facets": {
"space": "general",
"tags": [
"example"
]
},
"language": "en",
"authorship": "human",
"publication_state": "published",
"published_at": "2026-09-22T12:00:00Z",
"indexability": {
"decision": "index",
"reasons": []
},
"provenance": [
{
"service": "sources",
"type": "item",
"id": "itm_01J0000000000000000000000Z"
}
]
}Rejected: bad-visibility
{
"owner": "wiki",
"type": "page",
"id": "x",
"revision": 1,
"visibility": "everyone"
}Rejected: no-revision
{
"owner": "wiki",
"type": "page",
"id": "x"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('search.index-document@1', value); // { valid, errors: [{ path, message }] }