PHPackages                             glueful/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. glueful/meilisearch

ActiveGlueful-extension[Search &amp; Filtering](/categories/search)

glueful/meilisearch
===================

Meilisearch full-text search integration for Glueful Framework

v1.3.1(2mo ago)019MITPHPPHP ^8.3

Since Feb 4Pushed 2mo agoCompare

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

READMEChangelog (8)Dependencies (5)Versions (11)Used By (0)

Glueful Meilisearch Extension
=============================

[](#glueful-meilisearch-extension)

Full-text search integration for the Glueful Framework using [Meilisearch](https://www.meilisearch.com/).

Overview
--------

[](#overview)

The Meilisearch extension provides seamless integration between Glueful Framework and Meilisearch, an open-source, lightning-fast search engine. This extension enables models to be searchable with minimal configuration while providing advanced search features like typo tolerance, filtering, faceting, and geo-search.

Features
--------

[](#features)

- **Searchable trait**: Make any model searchable with a simple trait
- **Automatic syncing**: Keep search index in sync with database changes via model events
- **Transaction-safe indexing**: Indexing deferred until after database transactions commit
- **Fluent query builder**: Intuitive API for building complex search queries
- **Filters and facets**: Full support for Meilisearch filtering and faceted search
- **Geo-search**: Location-based search with radius and bounding box filters
- **Pagination**: Built-in pagination with metadata
- **Queue support**: Optional async indexing via queue workers
- **Batch operations**: Efficient bulk indexing with configurable batch sizes
- **Index prefixing**: Multi-tenant friendly with configurable index prefixes
- **CLI commands**: Index management and debugging tools

Installation
------------

[](#installation)

### Installation (Recommended)

[](#installation-recommended)

**Install via Composer**

```
composer require glueful/meilisearch

# Rebuild the extensions cache after adding new packages
php glueful extensions:cache
```

Glueful auto-discovers packages of type `glueful-extension` and boots their service providers.

Enable/disable in development (these commands edit `config/extensions.php`):

```
# Enable the extension (adds to config/extensions.php)
php glueful extensions:enable Meilisearch

# Disable the extension (comments out in config/extensions.php)
php glueful extensions:disable Meilisearch

# Preview changes without writing
php glueful extensions:enable Meilisearch --dry-run

# Create backup before editing
php glueful extensions:enable Meilisearch --backup
```

### Local Development Installation

[](#local-development-installation)

If you're working locally (without Composer), place the extension in `extensions/meilisearch`, ensure `config/extensions.php` has `local_path` pointing to `extensions` (non-prod).

### Verify Installation

[](#verify-installation)

Check status and details:

```
php glueful extensions:list
php glueful extensions:info Meilisearch
```

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

[](#requirements)

- PHP 8.3 or higher
- Glueful Framework 1.27.0 or higher
- Meilisearch server (v1.6+ recommended)
- meilisearch/meilisearch-php ^1.6 (installed automatically)

### Installing Meilisearch Server

[](#installing-meilisearch-server)

The extension requires a running Meilisearch server. Choose one of the following installation methods:

**Docker (Recommended)**

```
docker run -d -p 7700:7700 \
  -v $(pwd)/meili_data:/meili_data \
  -e MEILI_MASTER_KEY='your-master-key' \
  getmeili/meilisearch:v1.6
```

**Homebrew (macOS)**

```
brew install meilisearch
meilisearch --master-key="your-master-key"
```

**Binary Download**

Download the latest binary for your platform from the [Meilisearch releases page](https://github.com/meilisearch/meilisearch/releases) or follow the [official installation guide](https://www.meilisearch.com/docs/learn/getting_started/installation).

```
# Example for Linux
curl -L https://install.meilisearch.com | sh
./meilisearch --master-key="your-master-key"
```

**Meilisearch Cloud**

For production, consider [Meilisearch Cloud](https://www.meilisearch.com/cloud) for a fully managed solution.

Configuration
-------------

[](#configuration)

Set the following environment variables in your `.env` file:

```
# Meilisearch connection
MEILISEARCH_HOST=http://127.0.0.1:7700
MEILISEARCH_KEY=your-master-key

# Index prefix (optional, useful for multi-tenant or staging/production separation)
MEILISEARCH_PREFIX=myapp_

# Optional allowlist of indexes that can be queried via the HTTP search routes
# Comma-separated index names without prefix
MEILISEARCH_ALLOWED_INDEXES=posts,parps,entities

# Queue configuration (optional, for async indexing)
MEILISEARCH_QUEUE=false
MEILISEARCH_QUEUE_CONNECTION=redis
MEILISEARCH_QUEUE_NAME=search

# Batch configuration
MEILISEARCH_BATCH_SIZE=500
MEILISEARCH_BATCH_TIMEOUT=30

# Search defaults
MEILISEARCH_DEFAULT_LIMIT=20
MEILISEARCH_SOFT_DELETE=true
```

### Configuration File

[](#configuration-file)

The extension configuration is located at `config/meilisearch.php`:

```
