> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://turbopuffer.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://turbopuffer.ferndocs.com/_mcp/server.

# Hybrid Search

## Overview

Hybrid search issues multiple sub-queries concurrently and merges the results into a single ranked list. This is useful when neither pure vector nor pure BM25 search captures all the relevant documents.

## Multi-query with RRF

Use the multi-query endpoint to combine a vector search and a BM25 search, merged with Reciprocal Rank Fusion (RRF):

```typescript
const results = await client.namespaces.query("my-namespace", {
  queries: [
    { rankBy: ["vector", "ANN", queryVector], topK: 20 },
    { rankBy: ["content", "BM25", "search query"], topK: 20 },
  ],
  rerankBy: ["RRF"],
  topK: 10,
});
```

## RRF parameters

RRF can be tuned with a `rank_constant` (`k`):

```typescript
rerankBy: ["RRF", { rankConstant: 60 }]
```

Higher values reduce the influence of high-ranking documents from a single sub-query. Defaults to `60`.

## When to use hybrid search

* **Keyword + semantic intent**: a user query like "fast object storage database" benefits from both BM25 (exact keyword matching) and ANN (semantic similarity).
* **Sparse + dense vectors**: combine `SparseKNN` (e.g. from SPLADE) with ANN for state-of-the-art retrieval.
* **Multi-field ranking**: search across separate text fields simultaneously and merge the results.