Skip to main content
Infino retrieves from the same table several ways. Pick the mode that matches the question; you can also compose any of them in SQL. Every search returns rows: an Arrow table in Python, record batches in Rust, and plain objects in Node.js (pass { arrow: true } there for an Arrow table). Pass a projection to choose which columns come back.

Choose a search mode

Always pass a sensible top-k on production queries: it bounds both the work and the result size.

Full-text (BM25)

Ranked keyword search over an FTS-indexed column.
BM25 score is a similarity — higher is better. (Vector score is a distance; the two run in opposite directions.)

Query syntax

The query string accepts three operators besides plain terms. They work the same in the bm25_search SQL function. A phrase needs the column indexed with positions=True (see Indexing); on a column without positions it is an error. A query made only of excluded terms is also an error: give at least one positive term.

Counting matches

count returns how many rows match a BM25 keyword query, without fetching or ranking them — cheaper than a search when you only need the tally.

Unranked lookups

When you don’t need scoring, token_match (rows containing a token) and exact_match (rows whose column equals a value) return every matching row, unranked.
exact_match and token_match run over an FTS-indexed column. Index the column you want to match, for example IndexSpec().fts("doc_id"), to look it up this way.
Semantic search over a vector-indexed column. Embed the query with the same model you used to index (see Embeddings).
Vector score is a distance, so lower is closer. For cosine and l2sq, 0.0 is a perfect match; for negdot it is the negated dot product, so similar vectors score below zero. This is the opposite direction from BM25’s score (a similarity, higher is better). Don’t compare the two raw scores — hybrid search fuses them for you by rank.

Pushdown filter

Restrict the kNN to rows whose FTS-indexed column matches a text predicate. This is a pre-filter, where the kNN ranks only among matching rows, not a post-filter on the top-k.

Filtering BM25, hybrid, or by a scalar column

filter is specific to the vector_search method. To filter a BM25 or hybrid search, or to filter any search by a scalar column such as a tenant id, call the search as a SQL table function and add a WHERE:
This is a pre-filter as well: the search ranks only the rows that match the WHERE and returns the top k of those. Hybrid search runs BM25 and vector kNN over the same table and fuses their rankings with reciprocal-rank fusion (RRF), which is strong when a query has both keyword and semantic intent. It’s a first-class method — pass the text query and the query vector, and it returns ranked rows like the other searches:
Hybrid search needs both indexes on the table: an fts index on the text column and a vector index on the embedding column. It’s also available in SQL via the hybrid_search table function, where you can compose it with joins and filters.

Pagination

Searches return the top k; there is no offset argument and no cursor. To page through results:
  • In the SDK, ask for enough rows to cover the page you want (k = page * page_size) and slice off the last page_size.
  • In SQL, use LIMIT and OFFSET over the search function. k still bounds what the search returns, so it must be at least OFFSET + LIMIT, or the later pages come back empty.

Limitations

  • Vector search is approximate (IVF). It trades exactness for speed. Probe width and rerank budget are calibrated by the engine per table and per k; there are no tuning knobs to set.
  • Bring your own embeddings. Embed queries with the same model and dimension you indexed with.
  • The filter option exists on vector search only, and takes a text predicate over an FTS-indexed column. For BM25, hybrid, or scalar filters, use a SQL WHERE, which is also applied inside the search.
  • exact_match and token_match need an FTS-indexed column.

See also

Last modified on November 18, 2026