Search
Search
Full-text, fuzzy, vector, and hybrid search are first-class query expressions in Omnigraph.
Omnigraph has six built-in search modes. They are not separate services — they
are expressions you use directly inside .gq queries, alongside traversal,
filtering, and projection.
The six search modes
| Expression | Mode | Where it appears | What it does |
|---|---|---|---|
search(field, term) | Full-text | match | Filters to nodes whose field matches the search term via an inverted index |
fuzzy(field, term, distance) | Fuzzy | match | Filters with edit-distance tolerance for typos and near-matches |
match_text(field, phrase) | Text match | match | Filters with the current full-text backend; do not treat it as strict phrase adjacency |
bm25(field, term) | BM25 ranking | order | Ranks results by BM25 relevance score |
nearest(field, vector) | Vector KNN | order | Ranks results by nearest-neighbor distance over an indexed vector field; requires limit |
rrf(nearest(...), bm25(...)) | Hybrid | order | Combines two ranking signals with Reciprocal Rank Fusion; requires limit |
Where search expressions appear
Search expressions are used in two places inside a query:
matchblock —search(),fuzzy(), andmatch_text()act as filters. They restrict which nodes are returned.orderblock —bm25(),nearest(), andrrf()act as ranking functions. They sort results by relevance.
A query can combine both: filter in match, then rank in order.
query find_experts($term: String, $vec: Vector(1536)) {
match {
$p: Person
search($p.bio, $term)
}
return { $p.name, $p.bio }
order { rrf(nearest($p.embedding, $vec), bm25($p.bio, $term)) desc }
limit 10
}Index requirements
Search expressions require indexes on the fields they operate on:
| Search type | Schema annotation | Index created |
|---|---|---|
| Full-text, fuzzy, text match, BM25 | @index on a String field | Inverted index |
| Vector KNN | @index on a Vector(N) field | ivf_flat vector index with L2 metric |
Without the right index, the query compiler rejects the query at compile time.
node Person {
name: String @key
bio: String @index
embedding: Vector(1536) @index
}Combining search with traversal
Search expressions compose with the rest of the query language. You can filter by search, traverse edges, and project properties all in one query:
query experts_at_company($term: String) {
match {
$p: Person
search($p.bio, $term)
$p worksAt $c: Company { name: "Acme" }
}
return { $p.name, $c.name }
order { bm25($p.bio, $term) desc }
}Next steps
- Full-text Search — keyword search, fuzzy matching, text matching, and BM25 ranking.
- Vector Search — nearest-neighbor search over embeddings.
- Hybrid Search — combine BM25 and vector ranking with Reciprocal Rank Fusion.