Full-text search examples
← All examples6 full-text search examples, each on its own page. FTS on OriginChain is a runtime endpoint - you POST documents to a field and query them back, no schema declaration required. Every example has side-by-side cURL / Python / TypeScript / Go, the response shape, and notes on common mistakes.
The endpoint takes the form /v1/tenants/:t/fts/<schema>/<field>. Each field is its own independent inverted index. The doc_id you supply at index time is what comes back at search time - typically the row's primary key.
POST a doc_id + text to the FTS endpoint. Re-indexing the same doc_id atomically replaces the previous text.
Ask whether any doc contains a token. Returns matching doc_ids only, no ranking.
All tokens must match. Returns doc_ids. There is no OR in boolean mode - union client-side if you need it.
Tokens must appear in order, contiguously. Use for branded phrases, model numbers, log templates.
Lucene-default scoring (k1=1.2, b=0.75). Returns { doc_id, score } sorted by relevance. Use when ordering matters.
Index two fields separately, query each, merge results client-side with your own weights.