PHPackages                             elvenstar/statamic-meilisearch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. elvenstar/statamic-meilisearch

Abandoned → [statamic-rad-pack/meilisearch](/?search=statamic-rad-pack%2Fmeilisearch)Library[Search &amp; Filtering](/categories/search)

elvenstar/statamic-meilisearch
==============================

meilisearch search driver for Statamic

v4.1.0(1mo ago)1617.3k16MITPHPPHP ^8.2CI passing

Since Jun 17Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/statamic-rad-pack/meilisearch)[ Packagist](https://packagist.org/packages/elvenstar/statamic-meilisearch)[ Docs](https://github.com/statamic-rad-pack/meilisearch)[ RSS](/packages/elvenstar-statamic-meilisearch/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (18)Versions (33)Used By (0)

Statamic Meilisearch Driver
===========================

[](#statamic-meilisearch-driver)

This addon provides a [Meilisearch](https://www.meilisearch.com/) search driver for Statamic sites.

Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel 11+
- Statamic 6
- Meilisearch 1.0+

### Installation

[](#installation)

```
composer require statamic-rad-pack/meilisearch
```

Add the following variables to your env file:

```
MEILISEARCH_HOST=http://127.0.0.1:7700
MEILISEARCH_KEY=
```

The master key is like a password, if you auto-deploy a Meilisearch server they will most likely provide you with keys. On localhost you can make up your own master key then use that to generate your private and public keys. You will need these keys for front-end clients:

```
# Export the key
$ export MEILISEARCH_KEY=AWESOMESAUCE

# Start the meilisearch server again
$ meilisearch

# Generate the keys
curl \
  -H 'Authorization: Bearer AWESOMESAUCE' \
  -X GET 'http://localhost:7700/keys'
```

Add the new driver to the `statamic/search.php` config file:

```
'drivers' => [

    // other drivers

    'meilisearch' => [
        'credentials' => [
            'url' => env('MEILISEARCH_HOST', 'http://localhost:7700'),
            'secret' => env('MEILISEARCH_KEY', ''),
            // 'search_api_key' => env('MEILISEARCH_SEARCH_KEY')
        ],
    ],
],
```

You can optionally add `search_api_key` which makes it easier to call the key on the frontend javascript code:

```

window.meilisearch = new meilisearch({
    host: '{{ config:statamic:search:drivers:meilisearch:credentials:url }}',
    apiKey: '{{ config:statamic:search:drivers:meilisearch:credentials:search_api_key }}',
});

```

You can optionally publish the config file for this package using:

```
php artisan vendor:publish --tag=statamic-meilisearch-config

```

### Few words about Document IDs in meilisearch

[](#few-words-about-document-ids-in-meilisearch)

When you index your Statamic Entries, the driver will always transform the ID. This is required because meilisearch only allows `id` to be a string containing alphanumeric characters (a-Z, 0-9), hyphens (-) and underscores (\_). You can read more about this in the [meilisearch documentation](https://www.meilisearch.com/docs/learn/core_concepts/primary_key#invalid_document_id)

As an Entry, Asset, User or Taxonomy reference is a combination of the type, handle/container and ID separated with a `::` (e.g. assets::heros/human01.jpg, categories::cats) this could not be indexed by meilisearch.

As a Workaround, we take care add reference while indexing your entries automatically 🎉.

Internally Statamic will use `\Statamic\Facades\Data::find($reference)` to resolve the corresponding Statamic Entry, Asset, User or Taxonomy.

### Search Settings

[](#search-settings)

Any additional settings you want to define per index can be included in the `statamic/search.php` config file. The settings will be updated when the index is created.

```
'indexes' => [
    // articles
    'articles' => [
        'driver' => 'meilisearch',
        'searchables' => ['collection:articles'],
        'fields' => ['id', 'title', 'url', 'type', 'content', 'locale'],
        'settings' => [
          'filterableAttributes' => ['type', 'locale'],
        ],
    ],
],
```

You may include different types of settings in each index:

```
'indexes' => [
    'articles' => [
        'driver' => 'meilisearch',
        'searchables' => ['collection:articles'],
        'settings' => [
            'filterableAttributes' => ['type', 'country', 'locale'],
            'distinctAttribute' => 'thread',
            'stopWords' => ['the', 'of', 'to'],
            'sortableAttributes' => ['timestamp'],
            'rankingRules' => [
                'sort',
                'words',
                'typo',
                'proximity',
                'attribute',
                'exactness',
            ],
        ],
    ],
],
```

### Search Pagination

[](#search-pagination)

By default we limit the `maxTotalHits` to 1000000, if you want to modify this or any other pagination settings on the index, specify a pagination key:

```
'indexes' => [
    // articles
    'articles' => [
        'driver' => 'meilisearch',
        'searchables' => ['collection:articles'],
        'fields' => ['id', 'title', 'url', 'type', 'content', 'locale'],
        'pagination' => [
            'maxTotalHits' => 100,
        ],
    ],
],
```

### Extending

[](#extending)

You can extend the drivers functionality (e.g. in order to customize calls to meilisearch) by creating a class that extends `StatamicRadPack\Meilisearch\Meilisearch\Index` and instructing Laravel's [service container](https://laravel.com/docs/master/container#main-content) to use it:

```
use StatamicRadPack\Meilisearch\Meilisearch\Index;

class MyIndex extends Index {
    // Your custom logic here
}
```

```
// app/Providers/AppServiceProvider.php

$this->app->bind(\StatamicRadPack\Meilisearch\Meilisearch\Index::class, MyIndex::class);
```

### Common Errors

[](#common-errors)

#### 413 Request Entity Too Large

[](#413-request-entity-too-large)

You may encounter this bug on Laravel Forge for example, when you try sync the search documents for the first time. To overcome this you need to update the upload size limit in nginx.

Add `client_max_body_size` to the http section on `/etc/nginx/nginx.conf`:

```
http {
  client_max_body_size 100M;
  // other settings
}

```

Then restart the server, or run `sudo service nginx restart`.

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance95

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Recently: every ~205 days

Total

29

Last Release

52d ago

Major Versions

0.25.1 → 1.0.02022-05-09

1.1.0 → 2.0.02023-05-29

2.0.1 → v3.0.02023-10-16

v3.4.0 → v4.0.02026-01-29

PHP version history (4 changes)1.0.0PHP ^8.0

2.0.0PHP ^8.1|^8.2

v3.0.0PHP ^8.1

v3.4.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/883ee9a83f841aecdf6b30eee65aa63f067d68e2e4b8d634a8accc06e84301f8?d=identicon)[k4runa](/maintainers/k4runa)

---

Top Contributors

[![okaufmann](https://avatars.githubusercontent.com/u/4414498?v=4)](https://github.com/okaufmann "okaufmann (50 commits)")[![duncanmcclean](https://avatars.githubusercontent.com/u/19637309?v=4)](https://github.com/duncanmcclean "duncanmcclean (31 commits)")[![tao](https://avatars.githubusercontent.com/u/1446331?v=4)](https://github.com/tao "tao (19 commits)")[![lakkes-ra](https://avatars.githubusercontent.com/u/63732644?v=4)](https://github.com/lakkes-ra "lakkes-ra (12 commits)")[![ryanmitchell](https://avatars.githubusercontent.com/u/51899?v=4)](https://github.com/ryanmitchell "ryanmitchell (8 commits)")[![j6s](https://avatars.githubusercontent.com/u/3374170?v=4)](https://github.com/j6s "j6s (2 commits)")[![ym-henkelhiedl](https://avatars.githubusercontent.com/u/40430080?v=4)](https://github.com/ym-henkelhiedl "ym-henkelhiedl (2 commits)")[![Z3d0X](https://avatars.githubusercontent.com/u/75579178?v=4)](https://github.com/Z3d0X "Z3d0X (1 commits)")[![godismyjudge95](https://avatars.githubusercontent.com/u/3847288?v=4)](https://github.com/godismyjudge95 "godismyjudge95 (1 commits)")[![naabster](https://avatars.githubusercontent.com/u/1961461?v=4)](https://github.com/naabster "naabster (1 commits)")[![andjsch](https://avatars.githubusercontent.com/u/9936988?v=4)](https://github.com/andjsch "andjsch (1 commits)")

---

Tags

meilisearchstatamic-addonsearchmeilisearchstatamic

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/elvenstar-statamic-meilisearch/health.svg)

```
[![Health](https://phpackages.com/badges/elvenstar-statamic-meilisearch/health.svg)](https://phpackages.com/packages/elvenstar-statamic-meilisearch)
```

###  Alternatives

[statamic-rad-pack/meilisearch

meilisearch search driver for Statamic

1661.7k](/packages/statamic-rad-pack-meilisearch)[marcorieser/statamic-live-search

A Statamic Live Search realized with Laravel Livewire.

2210.5k](/packages/marcorieser-statamic-live-search)[cmsig/seal

Search Engine Abstraction Layer

32207.9k53](/packages/cmsig-seal)[cmsig/seal-symfony-bundle

An integration of CMS-IG SEAL search abstraction into Symfony Framework.

15195.8k5](/packages/cmsig-seal-symfony-bundle)[omure/scout-advanced-meilisearch

Laravel Scout extension that allows to use meilisearch advanced features as well as has an extended collection driver for testing purposes.

123.9k](/packages/omure-scout-advanced-meilisearch)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
