Explains that vector, full-text, and hybrid search run in the same runtime as graph traversal, so one query can combine nearest, bm25, and an Expand. Search functions are used inside match (to filter) or in return/order (to score and rank). Tabulates the functions and their backing indexes: nearest($x.vec, $q) (cosine k-NN over the IVF/HNSW vector index, requires a limit), search/fuzzy/match_text/bm25 over the inverted FTS index, and rrf(rank_a, rank_b, k=60) for Reciprocal Rank Fusion. The query vector for nearest is resolved from params or auto-embedded from text at runtime. A worked hybrid example fuses a vector rank and a bm25 rank with rrf(...) and orders by the fused score. Read when adding vector, full-text, or hybrid (RRF) search to a query, or scoring/ranking results.
Search
OmniGraph runs vector, full-text, and hybrid search in the same runtime as graph
traversal — a single query can combine a vector nearest,
a bm25 text score, and an Expand traversal. Search functions are used inside
match (to filter), or as expressions inside return / order (to score and
rank).
Functions
| Function | Purpose | Backing index |
|---|---|---|
nearest($x.vec, $q) |
k-NN vector search (cosine) | vector index (IVF / HNSW) |
search(field, q) |
Generic full-text search | inverted (FTS) index |
fuzzy(field, q [, max_edits]) |
Levenshtein-tolerant text search | inverted index |
match_text(field, q) |
Pattern match | inverted index |
bm25(field, q) |
BM25 relevance scoring | inverted index |
rrf(rank_a, rank_b [, k]) |
Reciprocal Rank Fusion of two rankings (default k=60) |
fuses scored rankings |
nearest()requires alimit. The query vector is resolved from the param map, or embedded from a text input at runtime via the configured embedding client.- Scores and ranks propagate as ordinary columns, so you can
returna score andorderby it.
Hybrid ranking with rrf
Reciprocal Rank Fusion combines two independent rankings (typically one vector and one text) into a single fused ranking, without needing the two score scales to be comparable. Rank each retrieval separately, then fuse:
query hybrid($q: String) {
match { $d: Document { } }
return {
$d,
rrf( nearest($d.embedding, $q), bm25($d.body, $q) ) as score
}
order { score desc }
limit 10
}
Indexes and embeddings
Search functions only work when the backing index exists — see
indexes for building vector and inverted indexes, and
embeddings for generating the vectors nearest searches over.