Search
Search answers keyword, semantic and hybrid queries across a namespace, indexes every write, and returns only what the caller may read.
Search finds Things in a Startup's namespace by words, by meaning, or both. Every write is indexed, and every result respects the caller's Permissions.
Contract
- Three modes:
fulltext,semanticandhybrid, the default. Hybrid ranks by keyword and by meaning, then reranks the merged list. - A record is searchable when its write returns. The index is a projection of the database and rebuilds from it.
- Results are ranked candidates, never a complete list. To get every match, filter a Collection with
whereinstead. - Each result carries its
$id, its score and the Version it read. - Results continue from the returned cursor, never from computed offsets.
- A caller sees only the records its Permissions read. A Startup's Sites search only the Collections a Setting makes public.
- An Agent searches first: the MCP
searchtool, thenfetch, thendo. - A ranking change can run as an Experiment, judged on click-through and task success.
Verbs
| Verb | Object | Event |
|---|---|---|
| Thing.list | Thing | None. |
Interfaces
Example
// shutterswap.com resells used camera gear and declares a `Listing` Noun. A buyer types "weather sealed body".
import { $ } from 'startup-builder'
const hits = await $.search('weather sealed body', { limit: 20 })
// [{ $id: 'https: //api.sb/ shutterswap.com/ listings/ listing_41', score: 0.91, version: 'v12' }, …]