---
title: "search.index-document@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/search.index-document"
updated: null
---

# search.index-document@1 · OpenVibe.Services

HTML: [search.index-document@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/search.index-document)

# IndexDocument `search.index-document@1`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.0).

- Version: 1.0.0
- Owner: search
- Visibility: first-party
- Status: active
- Compatibility: backward
- Decision: [ADR-018](/docs/adr/ADR-018)
- Schema: [`https://openvibe.network/contracts/search/index-document.v1.json`](/docs/contracts/search.index-document.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. | - `pattern ^[a-z][a-z0-9-]{1,39}$` |
| `type` | string | yes | Resource type inside the owner (page, post, story, entity, offer, coupon, instrument, item…). | - `pattern ^[a-z][a-z0-9_]{1,39}$` |
| `id` | string | yes | Resource id inside owner+type. Stable across revisions. | - `pattern ^[A-Za-z0-9][A-Za-z0-9._:~-]{0,127}$` |
| `revision` | integer | yes | Owner's monotonic revision of the resource. An older revision never overwrites a newer one; at equal revision a deletion wins. | - `minimum 0`<br>- `maximum 9007199254740991` |
| `deleted` | boolean |  | Deletion marker. true = tombstone; every other content field is ignored. | - `default false` |
| `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. | - `one of "public", "unlisted", "members", "private", "draft"` |
| `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). | - `no other fields` |
| `acl.subjects` | array of string |  |  | - `maxItems 200`<br>- `unique items`<br>- `items: pattern ^(usr\|gst)_[0-9A-HJKMNP-TV-Z]{26}$` |
| `acl.groups` | array of string |  | Opaque group keys owned by some service, e.g. role:admin (Network role), wiki.space:spc\_…:member. | - `maxItems 100`<br>- `unique items`<br>- `items: pattern ^[a-z][a-z0-9_.:-]{0,127}$` |
| `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. | - `maxItems 100`<br>- `unique items`<br>- `items: pattern ^[a-z][a-z0-9_.:-]{0,127}$` |
| `canonical_url` | string |  |  | - `pattern ^https?://`<br>- `format uri`<br>- `maxLength 2048` |
| `title` | string |  |  | - `maxLength 500` |
| `summary` | string |  |  | - `maxLength 4000` |
| `body` | string |  | Plain text for full-text search (no HTML). Keep it under the Events payload limit when publishing through Events. | - `maxLength 48000` |
| `facets` | object |  | Filterable values (category, tags, space, author subject, currency…). Filter with facet.<key>=<value>. |  |
| `language` | string |  | BCP 47 tag. | - `pattern ^[a-zA-Z]{2,3}(-[A-Za-z0-9]{2,8})*$` |
| `authorship` | enum |  |  | - `one of "human", "ai_assisted", "ai_generated", "imported"` |
| `provenance` | array of object |  | Where the content came from: typed references to source records (Sources items, citations, Media objects). | - `maxItems 50`<br>- `items: no other fields` |
| `provenance[].service` | string | yes |  | - `pattern ^[a-z][a-z0-9-]{1,39}$` |
| `provenance[].type` | string | yes |  | - `pattern ^[a-z][a-z0-9_]{1,39}$` |
| `provenance[].id` | string | yes |  | - `minLength 1`<br>- `maxLength 128` |
| `provenance[].revision` | integer |  |  | - `minimum 0` |
| `provenance[].label` | string |  |  | - `maxLength 200` |
| `provenance[].url` | string |  |  | - `pattern ^https?://`<br>- `format uri`<br>- `maxLength 2048` |
| `provenance[].retrieved_at` | string |  |  | - `format date-time` |
| `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. | - `one of "draft", "scheduled", "published", "unpublished", "retracted", "archived"` |
| `published_at` | string \| null |  |  | - `format date-time` |
| `updated_at` | string \| null |  |  | - `format date-time` |
| `indexability` | object |  | The owner's deterministic indexability decision (publishing packages, roadmap §32.3). Search can only make it stricter. | - `no other fields` |
| `indexability.decision` | enum | yes |  | - `one of "index", "noindex"` |
| `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. | - `maxItems 20`<br>- `unique items`<br>- `items: pattern ^[a-z][a-z0-9_]{1,63}$` |

## 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 }] }
~~~~
