Full-text search

Keyword search next to your SQL filters

BM25 ranking inside the SQL engine. Filter and join matches in the same query.

Example query
-- BM25 ranking, filtered like any other table
SELECT id, title, score
FROM bm25_search('conn.public.docs', 'content',
                 'kubernetes deployment', 100)
WHERE category = 'infrastructure'
ORDER BY score DESC
LIMIT 10;

How it works

  1. 1. Create a BM25 index

    Index the text column you want to search. Large indexes build in the background.

    CLI
    hotdata search create help_body_bm25 --type text \
      --from support.public.help_articles --column body
  2. 2. Search from the CLI

    Results come back ordered by relevance, with the columns you select.

    CLI
    hotdata search "billing refund" \
      --index help_body_bm25 \
      --select id,title,body \
      --limit 10
  3. 3. Search in SQL

    bm25_search returns every column plus a relevance score.

    SQL
    SELECT id, title, body, score
    FROM bm25_search(
      'support.public.help_articles', 'body', 'billing refund', 50
    )
    ORDER BY score DESC
    LIMIT 10;

Combining search with filters

bm25_search returns a table, so ranking, filters, and joins share one query.

Filter and join
Filter by any column, join other tables, and aggregate.
Pair with vector search
Exact terms and meaning together: hybrid search in one engine.
Vector search →
Agent memory
hotmemory recalls what an agent learned with BM25 and vectors in one query.
Agent memory →