# Searching
URL: /docs/searching

Query parameters, pagination, and the shape of search results.



```
GET /collections/{name}/search
```

## Query parameters [#query-parameters]

| Parameter        | Default            | Description                                                   |
| ---------------- | ------------------ | ------------------------------------------------------------- |
| `q`              | —                  | The search query                                              |
| `query_by`       | all text fields    | Comma-separated text fields to search                         |
| `filter`         | —                  | Filter expression — see [Filtering](/docs/filtering)          |
| `sort`           | relevance          | Sort expression — see [Sorting](/docs/sorting)                |
| `facet`          | —                  | Comma-separated facet fields — see [Faceting](/docs/faceting) |
| `limit`          | `10`               | Results per page (max `250`)                                  |
| `offset`         | `0`                | Results to skip (`offset + limit` capped at `10,000`)         |
| `prefix`         | `true`             | Treat the last token as a prefix match                        |
| `typo_tolerance` | collection setting | Override typo tolerance for this query                        |
| `match_mode`     | `all`              | `all` or `any` — whether every `query_by` term must match     |

## Response shape [#response-shape]

```json
{
  "found": 1,
  "found_is_exact": true,
  "search_time_ms": 0,
  "hits": [
    { "document": { "id": "1", "title": "Wireless Mouse" }, "text_match": 554.788 }
  ],
  "facets": null
}
```

* `found` — total matching documents (not just the current page)
* `found_is_exact` — whether `found` is an exact count
* `hits[].document` — the full indexed document
* `hits[].text_match` — the BM25 relevance score used for ranking, also
  usable as the `_text_match` sort key

## Pagination [#pagination]

Page through results with `limit`/`offset`:

<Tabs items="['cURL', 'TypeScript', 'Python', 'C#']">
  <Tab value="cURL">
    ```bash
    curl 'localhost:8108/collections/products/search?q=keyboard&limit=20&offset=40'
    ```
  </Tab>

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

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

    const results = await client.collection('products').search({
      q: 'keyboard',
      limit: 20,
      offset: 40,
    });
    ```
  </Tab>

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

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

    results = client.collection("products").search(q="keyboard", limit=20, offset=40)
    ```
  </Tab>

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

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

    var results = await client.Collection("products").SearchAsync(new SearchParams
    {
        Q = "keyboard",
        Limit = 20,
        Offset = 40,
    });
    ```
  </Tab>
</Tabs>

`offset + limit` is capped at `10,000` — for deep pagination past that,
narrow the query with a `filter` instead.

## Highlighting [#highlighting]

Tachyon does not currently return match highlighting (`<mark>`-style
snippets) in search results — this isn't in the response shape today. It's
tracked as a possible addition on the [Roadmap](/roadmap).

## Autocomplete [#autocomplete]

`GET /collections/{name}/suggest` completes the last token of a partial
query, prefix- and typo-tolerant, ordered by term frequency:

<Tabs items="['cURL', 'TypeScript', 'Python', 'C#']">
  <Tab value="cURL">
    ```bash
    curl 'localhost:8108/collections/products/suggest?q=key&query_by=title'
    ```
  </Tab>

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

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

    const suggestions = await client.collection('products').suggest({ q: 'key', queryBy: 'title' });
    ```
  </Tab>

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

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

    suggestions = client.collection("products").suggest(q="key", query_by="title")
    ```
  </Tab>

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

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

    var suggestions = await client.Collection("products").SuggestAsync(new SuggestParams { Q = "key", QueryBy = ["title"] });
    ```
  </Tab>
</Tabs>

```json
{
  "suggestions": [
    { "text": "keyboard", "count": 128, "typos": 0 }
  ],
  "search_time_ms": 0
}
```

Full parameter and response details: [API Reference → Search](/api/search).
