Sparse search
Vector search
ANN(...) accepts a float list or a text literal for lexical proxy embedding when no vector is stored.
BM25 tuning
Override the BM25k1 and b parameters per query:
k1 controls term-frequency saturation; b controls length normalization. Both are optional and default to the index settings.
Combined sparse + vector
ORDER BY score
ORDER BY score ASC is also supported. You can also order by a metadata column or a scalar function — see Functions & aliases.
Ranking knobs
Re-rank retrieved candidates after the base relevance score with field boosts and temporal decay. Both widen the candidate window so the re-rank covers the full result set, not just the page.BOOST
BOOST(field, factor) multiplies a document’s score by factor when field is present and non-empty. Repeat the clause for multiple fields (boosts multiply).
DECAY
DECAY(field, half_life=days) applies exponential time decay based on a timestamp field: score *= 0.5 ^ (age_days / half_life_days). The half_life keyword is optional.
EXPLAIN, the per-document score breakdown (base / boost / decay / final) appears in the provenance trace.
Facets
FACETS(col1, col2, ...) returns per-value counts over the full matched set (not just the returned page). Counts are exposed as facets on the result (SearchResults in Python).
HIGHLIGHT
HIGHLIGHT(len) adds a snippet column with the matched query terms wrapped in <em>...</em>, truncated to len characters.
OFFSET / LIMIT
EXPLAIN
EXPLAIN on a retrieval query executes the search and returns results alongside a structured JSON provenance trace in explain_text. The trace shows which documents were considered and dropped at each retrieval tier.
COUNT(*)), EXPLAIN still returns a plan string without executing.
Cannot combine with STREAM.
See Retrieval provenance for the full provenance schema.
DISTRIBUTED
STREAM (Python)
UseDatabase.sql_stream or toradb.sql.sql_stream to page results. Not a separate SQL keyword in all clients; the engine honors LIMIT/OFFSET per page.