Meilisearch backs the `meilisearch` index driver — typo-tolerant full-text search over
HTTP. Pin `images.store.index` and set `drivers.store.index` to `meilisearch` where
you need it (index does **not** auto-promote under Compose).

<Callout title="The one rule">
  Index stays `memory` in every environment until you set the driver map explicitly — there is no
  silent fallback to Meilisearch or pgvector.
</Callout>

## Quick start

<Steps>

<Step>
### Declare driver + image

```typescript title="oke.config.ts"
drivers: {
  store: {
    index: { dev: "meilisearch", test: "memory", prod: "meilisearch" },
  },
},
images: {
  store: { index: "getmeili/meilisearch:v1.53" },
},
```

</Step>

<Step>
### Keys written by oke docker

```bash title=".env.local"
OKE_STORE_INDEX_URL=http://127.0.0.1:7700
OKE_STORE_INDEX_KEY=…          # also accepted as MEILI_MASTER_KEY
```

Recipe injects into the container:

- `MEILI_MASTER_KEY=${OKE_STORE_INDEX_KEY}`
- `MEILI_ENV=${OKE_MEILI_ENV:-production}`
- `MEILI_NO_ANALYTICS=true`

</Step>

<Step>
### Search from a flow

Use `store.index(…)` without `{ dims }` for full-text (vector dims select pgvector).
Writes wait on Meilisearch tasks before returning.

</Step>

</Steps>

## Required env

| Variable              | Required?            | Meaning                                          |
| --------------------- | -------------------- | ------------------------------------------------ |
| `OKE_STORE_INDEX_URL` | **Yes**              | Base URL — boot fails without it                 |
| `OKE_STORE_INDEX_KEY` | **Yes** (production) | Master/API key; falls back to `MEILI_MASTER_KEY` |
| `MEILI_MASTER_KEY`    | Alternate            | Same secret, container-side name                 |
| `OKE_MEILI_ENV`       | Optional             | Passed as `MEILI_ENV` (default `production`)     |

## Data and backup

| Volume             | Path          | What it stores               |
| ------------------ | ------------- | ---------------------------- |
| `store-index-data` | `/meili_data` | Indexes, documents, settings |

**Backup means:** snapshot/restore that named volume (or Meilisearch dumps). Recreating
the container **keeps** data if the volume remains; deleting the volume wipes every index.

The master key is **not** inside the volume — it lives in `.env.local` / secrets.
Losing the key without a backup blocks admin API access even if data remains.

## Production note

Always set a non-empty `OKE_STORE_INDEX_KEY` when `MEILI_ENV=production` — Meilisearch
refuses insecure production mode without a master key. Prefer network isolation (compose
network only) plus the key; do not publish `:7700` on the public internet without auth.

Vector `ai.embed` into a meilisearch index fails loud — embeddings need `pgvector`,
not FTS. See [Store · Index](/docs/elements/store#index).

## What the recipe configures

| Field          | Value                                          |
| -------------- | ---------------------------------------------- |
| Container port | `7700`                                         |
| Healthcheck    | `wget` against `/health`, every 5s, 12 retries |
| Connection URL | `http://host:7700`                             |

## Troubleshooting

<Accordions>
<Accordion title="oke boot: meilisearch index needs OKE_STORE_INDEX_URL">

No silent memory fallback. Re-run `oke dev` or export `OKE_STORE_INDEX_URL`.
Docker-mode wording asks whether `.env.local` was written.

</Accordion>
<Accordion title="meilisearch index: GET/POST … failed (403) — or master key errors">

`OKE_STORE_INDEX_KEY` does not match `MEILI_MASTER_KEY` inside the container, or the key
was rotated without updating the app env. Align both sides and restart. Unreachable host
surfaces as `meilisearch index: unreachable at <url> — …`.

</Accordion>
</Accordions>

## Learn more

- [Store · Index](/docs/elements/store#index) — FTS vs vector drivers
- [Environment variables](/docs/reference/environment-variables) — index URL / key
- [Configuration](/docs/reference/configuration) — `drivers.store.index` union

## Next

<Cards>
  <Card
    title="OpenRouter"
    description="Zero Docker cloud AI for the same stack."
    href="/docs/recipes/openrouter"
  />
  <Card
    title="Postgres"
    description="pgvector alternative for embeddings."
    href="/docs/recipes/postgres"
  />
  <Card title="Store" description="Index facet API." href="/docs/elements/store" />
</Cards>
