Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Meilisearch Laravel Package

statamic-rad-pack/meilisearch

A Meilisearch search driver for Statamic that adds fast, typo-tolerant full-text search to your site. Automatically index entries, configure searchable fields, and query results through Statamic’s native search API—ideal for content-heavy sites needing instant, relevant results.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with composer require statamic-rad-pack/meilisearch and commit the lockfile so deploys use the same version.
  • Get a Meilisearch instance running locally (Docker is easiest: docker run -p 7700:7700 getmeili/meilisearch) and set MEILISEARCH_HOST / MEILISEARCH_KEY in .env.
  • Publish the addon config (php artisan vendor:publish and pick the Meilisearch entry) and point Statamic's search config at the meilisearch driver — usually in config/search.php, either as the default driver or per-index.
  • First real use case: mark a collection/searchable field as searchable, run php artisan statamic:search:index, then render results with the standard {{ search:results }} tag. If you already have a working Statamic search page, switching drivers should be a config change plus a reindex.
  • Look first at: the addon's config/ directory (index/engine options), Statamic's config/search.php (index definitions), and the statamic:search:* commands.

Implementation Patterns

  • Per-environment indexes. Prefix index names with the environment (products_local, products_production) in config/search.php. Sharing one index between local and production is the fastest way to get confusing, "half-missing" results.
  • One index per logical result set. Rather than dumping everything into a single index, define separate indexes for products, articles, docs, etc., each with its own searchable fields, and query them by name in the search:results tag.
  • Control the index schema explicitly. The package handles pushing documents, but ranking rules, filterable/sortable attributes, and searchable attributes should be set deliberately (via the addon config where exposed, otherwise through Meilisearch's settings API). Treat the index schema as part of your codebase, not something that emerges at runtime.
  • Deploy-time indexing. Add php artisan statamic:search:index to your deploy pipeline after migrations and content imports, and make it part of the release checklist. Pair it with a clear of the stale index when field mappings change.
  • Keep the queue in the loop. Bulk imports and entry saves can trigger indexing; run those on a queue worker in production and restart workers on every deploy so they pick up new code.
  • Driver swapping for tests and CI. Bind a fake or a local Meilisearch container in tests and override the driver via env. Avoid asserting on Meilisearch ordering — assert on the presence of expected IDs instead.
  • Multi-site awareness. Each site/locale typically needs its own index; verify that content in secondary sites is being indexed and that result links resolve to the correct site.
  • Result shaping in the view layer. Use the search tag's data/supplement options to hydrate entries rather than dumping raw Meilisearch hits into templates — it keeps views stable if the driver or document format changes.

Gotchas and Tips

  • Laravel 13 support is the headline of v4.1.0. Nothing else changed in this release, so an upgrade should be a no-op — but check your composer.json constraints for Statamic and Laravel before bumping, and re-run your test suite. If you're still on an older Laravel/Statamic pairing, stay on the previous 4.x tag rather than forcing the upgrade.
  • Index settings aren't automatic. Filterable and sortable attributes must be declared before you use them. A filter on an undeclared attribute silently returns nothing instead of erroring, which looks like a broken search page rather than a config bug.
  • Stale schema after changing searchable fields. Reindex and, if the field set changed materially, recreate/reconfigure the index. Meilisearch infers some things but won't fix your filterable list.
  • Keys matter. Use the admin/master key for indexing (server-side) and a search-only key for anything client-facing. A "search returns 403 in production only" bug is almost always a key-scope issue.
  • Empty queries and pagination. Blank or single-character queries behave differently across drivers. Decide explicitly what a blank query renders, and check limit/offset/pagination params against your view's expectations.
  • Unpublished and draft content. Confirm that drafts and private entries aren't leaking into the index — check indexing is scoped to published entries, and reindex after changing visibility rules.
  • Debugging workflow. When results look wrong, inspect the index directly (Meilisearch's task list and /indexes/<index>/documents endpoint) before touching Laravel. If the document is wrong, the problem is indexing; if the document is right, the problem is query/settings.
  • Typo tolerance and stop words can produce surprising matches in short queries. Tune matching strategy and searched attributes rather than hacking around it in templates.
  • Extension points: the driver is resolved through Statamic's search manager, so you can register your own driver or decorate the existing one in a service provider if you need custom document shaping, without forking the addon.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings