Full-text search

Every record is indexed for keyword search automatically. A query returns the records that contain its words, best match first, and only the ones the caller may read.

What is indexed

The index covers each record's natural key and its data, with the natural key weighted highest. It is a generated column in Postgres, so the database keeps it current as records are written.

How a query matches

A query matches records that contain the search words and ranks them by relevance, best first. Matching is on whole words, under English language rules. Substring and prefix matching on a single field belong to list queries, which have contains and starts-with filters for text fields. Retrieval by meaning is a separate feature, semantic search.

Confined to what the caller may read

The search runs under the caller's row-level access rules, so a record the caller cannot read is not a hit. On the public API each hit is then resolved the way an ordinary read would resolve it, and one the caller may not see is dropped.

Calling it

searchRecords searches across models and can be narrowed to one by its model key. Each hit returns the record's id, its model key, its natural key, a score and the content. The query needs the search:read scope, and a key restricted to specific models cannot run it across models. foir search runs the same search from a terminal.

Read the detail

The SDK reference lists the search calls on the data client, across models and per model.