## Search Products

```
GET /api/v1/search
```

Typo-tolerant, full-text search across product names, summaries, descriptions (including rich-text content), and SEO fields. Results are ranked by relevance, with title matches weighted highest. Queries are matched using both substring matching and trigram similarity, so minor misspellings (e.g. "choclate" for "chocolate") and diacritics (e.g. "lodz" for "Łódź") still return relevant results.

### Query Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `query` | `string` | – | **Required.** Search term (1-200 characters) |
| `limit` | `number` | 10 | Results per page (1-100) |
| `offset` | `number` | 0 | Results to skip |

### Response

```json
{
  "items": [
    {
      "type": "product",
      "id": "0191abc0-1234-7def-8000-000000000001",
      "name": "Classic Tee",
      "slug": "classic-tee",
      "summary": "A comfortable everyday tee",
      "image": "https://cdn.example.com/tee.jpg",
      "relevance": 0.875
    }
  ],
  "pagination": {
    "total": 3,
    "offset": 0,
    "limit": 10,
    "hasMore": false
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `type` | `string` | Always `"product"` |
| `id` | `string` | Product UUID |
| `name` | `string` | Product name |
| `slug` | `string` | URL-safe slug |
| `summary` | `string \| null` | Short product summary |
| `image` | `string \| null` | URL of the first product image, or `null` |
| `relevance` | `number` | Relevance score (0-1), higher is better |

```bash
curl -H "Authorization: Bearer your_api_key" \
  "https://your-store.yns.store/api/v1/search?query=tee&limit=5"
```