# Bm25 (@salmonui/mcp)

> The Bm25 class of @salmonui/mcp: A BM25 index over documents made of weighted fields.

Canonical: https://salmonui.dev/docs/reference/mcp/Bm25

```ts
import { Bm25 } from '@salmonui/mcp';
```

Entry index: https://salmonui.dev/docs/reference/mcp (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/mcp.md).

## Reference

Kind: class

```ts
class Bm25 {
    #private;
    constructor(documents: readonly (readonly SearchField[])[]);
    get size(): number;
    search(query: string): SearchHit[];
}
```

A BM25 index over documents made of weighted fields.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `__#3@#private` | `#private;` |  |  |
| `size` | `get size(): number;` |  |  |
| `search` | `search(query: string): SearchHit[];` |  | Documents matching any query term, best first. |
