Download the PHP package elvenstar/statamic-meilisearch without Composer
On this page you can find all versions of the php package elvenstar/statamic-meilisearch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elvenstar/statamic-meilisearch
More information about elvenstar/statamic-meilisearch
Files in elvenstar/statamic-meilisearch
Package statamic-meilisearch
Short Description meilisearch search driver for Statamic
License MIT
Homepage https://github.com/statamic-rad-pack/meilisearch
Informations about the package statamic-meilisearch
Statamic Meilisearch Driver
This addon provides a Meilisearch search driver for Statamic sites.
Requirements
- PHP 8.1+
- Laravel 10+
- Statamic 5
- Meilisearch 1.0+
Installation
Add the following variables to your env file:
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:
Add the new driver to the statamic/search.php
config file:
You can optionally add search_api_key
which makes it easier to call the key on the frontend javascript code:
You can optionally publish the config file for this package using:
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
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
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.
You may include different types of settings in each index:
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:
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 to use it:
Common Errors
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
:
Then restart the server, or run sudo service nginx restart
.
All versions of statamic-meilisearch with dependencies
meilisearch/meilisearch-php Version ^1.0
guzzlehttp/guzzle Version ^7.3
http-interop/http-factory-guzzle Version ^1.0
illuminate/support Version ^10.0 || ^11.0
statamic/cms Version ^5.0