Поисковый сервис
Сервисы/Meilisearch

Сервис Meilisearch

Самостоятельно размещаемый Meilisearch для быстрого полнотекстового поиска по данным приложения с учётом опечаток и постоянным хранилищем индексов.

Вы добавляете этот сервис в стек и выбираете там его версию и ресурсы. Каждое окружение может их переопределить.

В StackMaster

Как Meilisearch работает в StackMaster

What Wodby sets up for this Meilisearch service. It runs the official Meilisearch image as a single instance, configured through environment variables set by the manifest.

How applications reach it

  • Inside the cluster: http://<app service name>:7700. Port 7700 also has a public HTTPS domain, so browsers and mobile apps can search Meilisearch directly.
  • Every route except GET /health needs an API key, sent as Authorization: Bearer <key>.
  • The master key is generated by Wodby (token master_key) and is in MEILI_MASTER_KEY inside this container. Use it only to manage API keys and on the backend; never put it in browser code or the repository.
  • Meilisearch creates default keys from the master key, including Default Search API Key (search only, safe for frontends) and Default Admin API Key (all actions, for backends that index documents). List them with GET /keys and the master key, or create narrower keys with POST /keys.
  • A service linked to this one receives the address and keys in variables named by the linking service, for example MEILISEARCH_HOST set to http://{{link.host}}:{{link.port}} and MEILISEARCH_KEY to {{link.tokens.master_key}}. Read them in code.

What is configured

  • MEILI_ENV is development in dev environments, which keeps the search preview at the service address, and production everywhere else, which turns the preview off. Both use the master key.
  • MEILI_NO_ANALYTICS turns Meilisearch's telemetry off.
  • The service is not scalable: Meilisearch runs one instance on one volume.
  • Indexing uses up to two thirds of the container memory limit. Set a memory limit that fits the largest indexing batch; change it with MEILI_MAX_INDEXING_MEMORY only when needed.
  • The container runs as user 1000, not root.

Version updates

A Meilisearch database opens only with the version that wrote it. The manifest sets MEILI_UPGRADE_DB, so when an image update brings a newer version, Meilisearch upgrades the database in place on startup. The upgrade runs as an upgradeDatabase task (GET /tasks?types=upgradeDatabase); new tasks wait for it, searches keep working.

Meilisearch warns that this upgrade is not atomic and can, rarely, corrupt the database. Before upgrading a production environment, create a dump (POST /dumps), or be ready to reindex from the application's own data. A failed or stuck upgrade task can be cancelled, which rolls the database back. A database from Meilisearch older than 1.12 cannot be upgraded in place and must be moved with a dump.

Changing configuration

Meilisearch settings are environment variables named MEILI_* on this service. Index settings (searchable, filterable and sortable attributes, ranking rules, synonyms) are set through the API per index, not in the manifest.

Changing the master key changes every key derived from it: the default keys and all keys created with POST /keys stop working, and clients need the new keys.

Data

The database is in /meili_data/data.ms on the data volume. Dumps (POST /dumps) are written to /meili_data/dumps and snapshots (POST /snapshots) to /meili_data/snapshots on the same volume, so they use its space. The manifest declares no Wodby backups, imports or actions.

Check the result

From this service's container:

  • curl -s localhost:7700/health
  • curl -s -H "Authorization: Bearer $MEILI_MASTER_KEY" localhost:7700/version
  • curl -s -H "Authorization: Bearer $MEILI_MASTER_KEY" localhost:7700/keys

Обзор

Технический профиль Meilisearch

Здесь перечислены версии, которые можно выбрать для Meilisearch в стеке или окружении. Сам сервис публикуется ревизиями, и стек ссылается на конкретную ревизию.

Тип сервиса

Поисковый сервис

Версии

1

Постоянные тома

Meilisearch data

Стеки

Стеки, в которые входит Meilisearch

Meilisearch входит в этот публичный стек. Можно создать приложение из публичного стека как есть или добавить сервис в собственный стек.

Конфигурация

Конфигурация сервиса Meilisearch

Сервис Meilisearch объявляет следующее. Если значение можно изменить, его задаёт стек, а каждое окружение может его переопределить.

Технические домены

StackMaster выдаёт каждому публичному HTTP-порту технический домен с TLS-сертификатом и продлевает сертификат. Порт, который сервис помечает как частный, домен не получает. Можно добавить собственные домены.

Тома

Meilisearch data