OriginChainDB
Database endpoints

Suggest completions

Find completions and spelling or phrase corrections using an indexed field's terms.

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

Offer useful alternatives to a searchCompletion, term and phrase requests return different suggestion fields.
  1. Choose a suggestion typeComplete a prefix or correct terms or phrases.
  2. Use the field's indexed termsSupply the prefix or query text for that type.
  3. Read the suggested candidatesUse frequency and scan details to interpret results.

Before you start

Use your database bearer token.

Connection setup

Index text in the target field before asking for term or prefix suggestions.

Path parameters

FieldTypeRequired
tenantstringRequired
tablestringRequired

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
  • Tagged by kind: completion | term | phrase.
  • completion requires prefix and accepts size, order (frequency | lexicographic), max_scan.
  • term requires text and accepts size, max_edits, mode (missing | popular | always), min_word_length.
  • phrase requires text and accepts size, max_edits, candidates_per_term, confidence (default 1.0), min_word_length.
  • A missing or unknown kind is rejected by body parsing.
FieldTypeRequired
candidates_per_termintegerOptional
confidencenumberOptional
fieldstringRequired
kindstringRequired
max_editsintegerOptional
max_scanintegerOptional
min_word_lengthintegerOptional
modestringOptional
orderstringOptional
prefixstringOptional
sizeintegerOptional
textstringOptional

Read the result

The result shape follows kind: completion returns completions, while term and phrase requests return their own suggestions. Frequency and scan fields help you interpret how candidates were selected.

Response statuses

HTTP status reference
StatusWhat to do
200OK
400Correct the request before retrying.
401Check the credential and Authorization header.
402Check feature access or available credits.
403Check tenant access, roles and permissions.
404Check the resource ID and API route.
408Reduce query work or adjust the timeout.
413Split or reduce the request body.
415Send the required Content-Type.
422Correct the values or unsupported combination.
429Honor Retry-After when present; back off.
499The client cancelled the request.
500Check the outcome before retrying a write.
501Check deployment support for this operation.
503Honor Retry-After when present; check write outcomes.
© 2026 Silicoyn Technologies Pvt Ltd