Keyword (BM25) search
infino_keyword_searchSearch a table by literal keywords or phrases and get results ranked by BM25 relevance, including scores and selected columns. Ideal for identifiers, error codes, or exact phrases.
Instructions
Use when the query is literal terms — identifiers, error codes, product names, exact phrases — and you want results ranked by relevance. BM25 full-text search over a text column: ranks rows by how well the query's tokens (and their stems) match, each with a relevance score (higher is better) plus the columns you project ('columns'; the full text column by default). Matches exact tokens, not synonyms or paraphrases. Prefer this over SQL LIKE for known literal terms. For meaning-based search use infino_semantic_search; for both at once use infino_hybrid_search.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | Maximum results to return. | |
| mode | No | Match any query token ('or', the default) or require every token ('and'). | |
| query | Yes | Query terms, matched as literal tokens. | |
| stats | No | BM25 statistics scope: 'per_superfile' (the default; each segment scored against its own statistics) or 'global' (one table-wide idf, so a table written in many small batches ranks like one corpus). | |
| table | Yes | Table to search. | |
| column | No | Text column to search; inferred from the table schema when omitted. | |
| columns | No | Which of the table's columns each hit returns, with full values (a projection passed straight to the engine). Defaults to the searched column; '_id' and 'score' are always included. Any column works: ['id'] for compact hits at a large k, ['id', 'text'] to get the full text alongside an id to cite, ['title', 'created_at'] for metadata. Nothing is truncated; read fewer columns or a smaller k to keep results small. |