# Relevance & BM25
URL: /docs/relevance-bm25

How Tachyon ranks matching documents.



Tachyon ranks results with BM25, a standard lexical relevance function: a
document scores higher for a query term the more often that term appears in
it, discounted by how common the term is across the whole collection and
normalized for document length. It's the same family of scoring function
used across most full-text search engines.

Every hit includes its score:

```json
{ "document": { "id": "1", "title": "Wireless Mouse" }, "text_match": 554.788 }
```

`text_match` is also usable as a sort key — see
[`_text_match` in Sorting](/docs/sorting).

## Per-field boosts [#per-field-boosts]

A field can carry an optional `boost` multiplier in its schema definition,
increasing its contribution to a document's score relative to other fields:

```json
{ "name": "title", "type": "text", "boost": 2.0 }
```

<Tabs items="['cURL', 'TypeScript', 'Python', 'C#']">
  <Tab value="cURL">
    ```bash
    curl -X POST localhost:8108/collections \
      -H 'Content-Type: application/json' \
      -d '{
        "name": "products",
        "fields": [
          {"name": "title", "type": "text", "boost": 2.0},
          {"name": "description", "type": "text"}
        ]
      }'
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    import { Tachyon } from 'tachyon-sdk';

    const client = new Tachyon({ url: 'http://localhost:8108' });

    await client.collections.create({
      name: 'products',
      fields: [
        { name: 'title', type: 'text', boost: 2.0 },
        { name: 'description', type: 'text' },
      ],
    });
    ```
  </Tab>

  <Tab value="Python">
    ```python
    from tachyon_sdk import Tachyon

    client = Tachyon(url="http://localhost:8108")

    client.collections.create({
        "name": "products",
        "fields": [
            {"name": "title", "type": "text", "boost": 2.0},
            {"name": "description", "type": "text"},
        ],
    })
    ```
  </Tab>

  <Tab value="C#">
    ```csharp
    using Tachyon.Sdk;

    var client = new TachyonClient(new TachyonClientOptions { Url = "http://localhost:8108" });

    await client.Collections.CreateAsync(new CollectionSchema
    {
        Name = "products",
        Fields =
        [
            new FieldSchema { Name = "title", Type = FieldType.Text, Boost = 2.0 },
            new FieldSchema { Name = "description", Type = FieldType.Text },
        ],
    });
    ```
  </Tab>
</Tabs>

## Query execution [#query-execution]

For multi-term queries, Tachyon uses block-max WAND query pruning to skip
over blocks of postings that can't possibly make the current top-K results,
rather than scoring every candidate document exhaustively. This is a
performance optimization, not a ranking difference — see
[Architecture → Query Pipeline](/architecture#query-pipeline) for how it
works.
