Theme
Search API
Full-text search across all published Stories in a Space. Powered by Meilisearch — typo-tolerant, sub-30 ms average response, no auth required for the public CDN endpoint.
Endpoint
http
GET /v1/cdn/{space}/search?q={query}Anonymous (no token). Rate-limited at 600/min per IP.
Query params:
| Param | Default | Notes |
|---|---|---|
q | (required) | The search term |
lang | space default | BCP-47 tag; restricts results to one locale |
per_page | 20 | 1–50 |
page | 1 | |
attributes | all searchable | comma-separated whitelist of fields |
Response
json
{
"data": [
{
"id": "14-de_at",
"story_id": 14,
"story_uuid": "468063e5-583a-4254-b393-dcd167cfcff1",
"slug": "marketing-demo",
"full_path": "/marketing-demo",
"lang": "de-AT",
"headline": "Diese Box ist live …",
"lead": null,
"status": "published",
"updated_at": 1779797878
}
],
"meta": {
"total": 1,
"query_time_ms": 2
}
}Indexing
The index is populated by:
peacock:reindex-stories— full rebuild (php artisan peacock:reindex-stories --space=demoor--all).- Auto-update on
story.published/story.unpublishedevents (triggered fromStory::publish()via Laravel events).
Run a full reindex after:
- Major schema changes
- Meilisearch upgrade
- Switching Meilisearch hosts
Searchable fields
Per default the index contains:
headline(highest weight)lead/ subtitlebody_text(concatenated text content of all blocks)tags(if Blueprint defines them)slug/full_path(lowest weight, mainly for prefix matches)
The attributes query param can narrow the search; e.g. ?attributes=headline,lead ignores body content.
Typo tolerance
Default: 1 typo for 5–8 char words, 2 typos for ≥9 chars. Adjust in Meilisearch settings (out of band; Phase 9 UI for this lands later).
Operator: deploying Meilisearch in production
The docker-compose ships Meilisearch on localhost:7700. For prod:
- Add
meilisearchservice to your compose / k8s manifest - Set
MEILISEARCH_HOST=http://meilisearch:7700 - Set
MEILISEARCH_KEY=<long random>(master-key, kept secret) - Run
php artisan peacock:reindex-stories --allafter first deploy - Configure backup snapshots — Meilisearch supports
POST /snapshots
See also
/api/cdn— single-story read/api/cdn-caching— search responses are NOT cached (per-query), unlike single-story reads