OriginChainDB
Database endpoints

Index a document

Indexes the text of one document for full-text search on a table field.

POST /v1/tenants/{tenant}/fts/{table}/{field}

Make one document's words searchableSuccess returns an empty 201 response, not JSON.
  1. Choose a document IDReuse the source record's identifier.
  2. Index its textSelect the table field and analyzer.
  3. Find it through text searchUse the matching ID to reopen the source.

Before you start

Use your database bearer token.

Connection setup

Choose the table and text field to index. The example indexes document p1 under demo_docs/body.

Path parameters

FieldTypeRequired
tenantstringRequired
tablestringRequired
fieldstringRequired

Headers

FieldTypeRequiredDescription
x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key.
x-oc-db-keystringOptionalAPI key of the x-oc-db-user user.

Request body

application/json

Limits and accepted values
  • The document key is `doc_id`.
  • `analyzer` is a string ("keyword", "whitespace") or an object such as {"language": "english"};
  • absent uses the default analyzer.
  • `values` indexes each string as one exact token instead of analysing `text` (`text` is still required).
  • Success is 201 with an empty body.
FieldTypeRequired
analyzerany JSONOptional
doc_idstringRequired
textstringRequired
valuesstring[]Optional
Fields in values
FieldTypeRequired
valuesstringOptional

Read the result

A successful write returns 201 with an empty body. Do not attempt to decode JSON from it. Use the same doc_id when relating the search result to your source record.

Response statuses

HTTP status reference
StatusWhat to do
201Created
400Correct the request before retrying.
401Check the credential and Authorization header.
402Check feature access or available credits.
403Check tenant access, roles and permissions.
409Resolve the conflict before retrying.
413Split or reduce the request body.
415Send the required Content-Type.
422Correct the values or unsupported combination.
429Honor Retry-After when present; back off.
500Check the outcome before retrying a write.
502Check service availability and the write outcome.
503Honor Retry-After when present; check write outcomes.
ยฉ 2026 Silicoyn Technologies Pvt Ltd