Search and aggregation
The search index answers the questions people type: a lot code half remembered, a shop name misspelled, "the delivery that was late on the ferry last Friday". It holds a text index, columnar values for sorting, facets and aggregations, and vectors for semantic search. This page explains how properties are analyzed, which query types exist, how ranking works, and how security shapes every result, count and facet
In the platform today
Keyword, similarity and hybrid search run in the platform service with tests. Every object type is indexed by its title and its string and array properties. Document sources listed under documents: in ontology.yaml, and documents read by document extraction, are indexed in overlapping chunks. Ranking is computed over only the entries the caller may see after access labels, row policy and hidden properties, so filtering always happens before ranking. A query word that matches nothing visible is corrected to the closest visible word
With retrieval.embedding set, entries also get vectors from a small open-source model, BAAI/bge-small-en-v1.5, run on the same machine through fastembed, so no text leaves for embeddings. Search can then be vector or hybrid, which combines the keyword and vector rankings. Vectors are made only from properties hidden from nobody, and are stored, so a restart reads them back and only changed entries are embedded again
retrieval:
embedding: { model: BAAI/bge-small-en-v1.5 } # model files kept in <lake>/_models
Extracted documents come from POST /api/v2/documents: PDFs, emails and text read into typed fields with a confidence and the quoted passage for each, checked by a person on the Documents screen under Data, and accepted to run the document kind's action. They are set up under documents.extraction and documents.kinds. Analyzers per property, French, the search box syntax, facets and vector properties are delivered on request, as described below
How properties are indexed
Today, every object type is indexed by its title and its string and array properties. On request, each property chooses its indexing and analyzer, including French and bilingual, with identifiers split on their hyphens and kept out of fuzzy matching
Text queries
Text predicates are filters like any other, so they combine with property filters, link traversals and aggregations in one object set. The difference is that they can also rank
| Predicate | Matches |
|---|---|
$search | Any of the terms in any searchable property, ranked. The default for a search box |
$anyWord | At least one term in the named property |
$allWords | Every term in the named property, in any order |
$phrase | The terms in order, with an optional slop of up to 5 positions |
$prefix | Terms starting with the input, on properties with prefix indexing |
$fuzzy | Terms within an edit distance of the input |
$regex | The whole keyword value against a regular expression |
$search ranks a match in the title property above a match in aliases, and both above a match anywhere else, and you can set per-property boosts in the type. Exact keyword matches on identifiers always rank above partial matches, so typing a full lot code puts that lot first
// Issues due on 30 October whose plan mentions any of these words
const hits = await mso.objects(Issue)
.where({ plan: { $anyWord: "hold re-weigh silo" } })
.where({ due: { $gte: "2026-10-30", $lt: "2026-10-31" } })
.page({ pageSize: 20 });
// Ranked keyword and similarity search across types, with the matching passage
const ranked = await mso.search("silo limit tonight", { types: ["issue"], limit: 20 });
On request, a $search filter that ranks inside an object set, ordering by $relevance and highlighted fragments, as below
const hits = await mso.objects(Issue)
.where({ $search: { query: "silo limit tonight", fuzzy: true } })
.where({ due: { $gte: "2026-10-30", $lt: "2026-10-31" } })
.page({ pageSize: 20, orderBy: { $relevance: "desc" }, highlight: { fragments: 2 } });
// hits.data[0].$highlight.plan
// ["move B-0844 to start 22:00 <em>tonight</em> on Line 1",
// "to the cheese make before the <em>limit</em>"]
Fuzzy matching
Fuzzy matching finds terms within a small edit distance of what was typed, counting an insertion, a deletion, a substitution or a swap of two neighbouring letters as one edit. The allowed distance grows with the length of the term, because one wrong letter in a three-letter word changes the word, while one wrong letter in "refrigeration" is a typo. So strawbery matches strawberry, while a two-letter term such as NS must match exactly
Fuzzy queries stay fast on large vocabularies, and exact matches always outrank fuzzy ones
Lot codes, batch numbers and silo ids differ from their neighbours by one character by design. A fuzzy search for B-0841 would happily match B-0842. Properties marked as identifiers ignore fuzzy matching even when a query asks for it
Search box syntax
On request, the search boxes in the Operations view and on the Search screen in Explore accept a compact syntax that compiles to the same predicates: phrases, exclusions, property values and ranges, a single object type and one link, as in type:delivery crossing:ferry -status:Delivered
Semantic search
The similarity search in the platform today is described under In the platform today; the rest of this section is delivered on request. Keyword search fails when the words differ: a driver writes "reefer alarm, unit cycling" and a planner searches for "temperature problem". Semantic search compares meaning instead. A vector property holds an embedding of a text property, and the index finds the nearest vectors to the embedding of the query
On request, any text property can have a vector property, embedded at sync time through the model gateway or supplied by your pipeline as a column, with long text split into chunks linked to their source object. No customer data is used to train models
Hybrid ranking
Most real queries do best with both kinds of evidence. A hybrid query runs the keyword query and the vector query separately, then combines the two ranked lists, so an object near the top of either list ranks well. Fusion uses ranks, not raw scores, so neither list can dominate because its scores happen to be larger
Filters run before ranking, not after it. Searching as a person whose row policy shows only some issues still returns the best matches from the allowed set, rather than the best matches overall with most of them filtered away
Facets and aggregations
On request, facets count results in the same request so panels and rows agree, and a multi-select facet ignores its own filter when counting. Aggregations run on the columnar form of each property without loading objects; the request and response shapes are in object sets
Security in search
Search is where data leaks hide in many systems: a count that includes rows you cannot open, a highlight that shows a hidden field, a ranking that moves because of a document you cannot see. The query service closes each of these
| Control | Effect on search |
|---|---|
| Row access | Row policies become filters inside the query, before scoring, so results, totals, facets and aggregations never count hidden objects |
| Hidden properties | Not matched, not highlighted, not faceted and not sortable for readers who cannot see them |
| Masked properties | Not searchable for readers who see the masked form, so a value cannot be probed one guess at a time |
| Access labels | Objects whose access labels the reader does not hold are filtered like row access |
| Relevance scores | On types with row policies, only ranks are returned, not raw scores, because term statistics span all objects |
An agent searching on behalf of a person gets exactly that person's view, through the same filters
Limitations
- Changing an analyzer, or turning on full text, prefix or regex on existing data, needs a reindex before the change applies to objects already indexed
- Analyzers are provided for English and French only. Text in other languages is indexed with the standard analyzer, without stemming
- Identifier properties ignore fuzzy matching even when a query asks for it
- Semantic search needs a vector property. Embeddings are computed at sync time, so text edited by an action is searchable by meaning only after the vector is recomputed
- Raw relevance scores are not returned on types with row policies, only ranks. Scores cannot be compared across requests or readers
- Masked properties are not searchable for readers who see the masked form, even by exact value