PHPackages                             areirei/meilisearch-laravel-scout - 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. areirei/meilisearch-laravel-scout

ActiveLibrary[Search &amp; Filtering](/categories/search)

areirei/meilisearch-laravel-scout
=================================

Laravel Scout custom engine for MeiliSearch

v0.12.6(4y ago)09MITPHPPHP ^7.3|^8.0

Since Apr 18Pushed 4y agoCompare

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

READMEChangelogDependencies (8)Versions (22)Used By (0)

 [![MeiliSearch Laravel Scout](https://camo.githubusercontent.com/b35f191be0bee8c2862a6ed2a62ee8d168a16fcee798aee9a075d2e91cd8b435/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6d65696c697365617263682f696d6167652f75706c6f61642f76313538373430323333382f53444b732f6d65696c697365617263685f6c61726176656c5f73636f75742e737667)](https://camo.githubusercontent.com/b35f191be0bee8c2862a6ed2a62ee8d168a16fcee798aee9a075d2e91cd8b435/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6d65696c697365617263682f696d6167652f75706c6f61642f76313538373430323333382f53444b732f6d65696c697365617263685f6c61726176656c5f73636f75742e737667)

\[DEPRECATED\] MeiliSearch Laravel Scout
========================================

[](#deprecated-meilisearch-laravel-scout)

####  [MeiliSearch](https://github.com/meilisearch/MeiliSearch) | [Documentation](https://docs.meilisearch.com) | [Slack](https://slack.meilisearch.com) | [Roadmap](https://roadmap.meilisearch.com/tabs/1-under-consideration) | [Website](https://www.meilisearch.com) | [FAQ](https://docs.meilisearch.com/faq)

[](#--meilisearch---documentation---slack---roadmap---website---faq)

 [![Latest Stable Version](https://camo.githubusercontent.com/156704e8c786a4d04d8ff02c16f44dad5d1dbea49886d0da55ba501c98e731e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617265697265692f6d65696c697365617263682d6c61726176656c2d73636f7574)](https://packagist.org/packages/areirei/meilisearch-laravel-scout) [![Actions Status](https://github.com/areirei/meilisearch-laravel-scout/workflows/Tests/badge.svg)](https://github.com/areirei/meilisearch-laravel-scout/actions) [![License](https://camo.githubusercontent.com/221ae99f391396653ec4cf4158e721ec628894184f54dd612610bb095a02125c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d696e666f726d6174696f6e616c)](https://github.com/areirei/meilisearch-laravel-scout/blob/main/LICENSE) [![Bors enabled](https://camo.githubusercontent.com/203d2b5ff5b042e964812f6af35b8856f889051d5455f18184e369e8fb49c821/68747470733a2f2f626f72732e746563682f696d616765732f62616467655f736d616c6c2e737667)](https://app.bors.tech/repositories/29019)

⚡ The MeiliSearch driver for Laravel Scout

---

⚠️ **This package is deprecated. We recommend you to use [Laravel Scout](https://github.com/laravel/scout) that now supports MeiliSearch.**

---

**MeiliSearch Laravel Scout** is a **MeiliSearch** driver for Laravel.

**MeiliSearch** is an open-source search engine. [Discover what MeiliSearch is!](https://github.com/meilisearch/MeiliSearch)

Table of Contents
------------------

[](#table-of-contents-)

- [📖 Documentation](#-documentation)
- [🔧 Installation](#-installation)
- [🚀 Getting Started](#-getting-started)
    - [Indexes](#indexes)
    - [Search](#search)
- [🗃️ Setting](#-setting)
    - [Displayed](#displayed)
    - [Distinct](#distinct)
    - [Filterable](#filterable)
    - [Ranking](#ranking)
    - [Searchable](#searchable)
    - [Sortable](#sortable)
- [🤖 Compatibility with MeiliSearch](#-compatibility-with-meilisearch)
- [💡 Learn More](#-learn-more)
- [Development Workflow and Contributing](#development-workflow-and-contributing)

📖 Documentation
---------------

[](#-documentation)

See our [Documentation](https://docs.meilisearch.com/learn/tutorials/getting_started.html) or our [API References](https://docs.meilisearch.com/reference/api/).

Also, take a look at the [Wiki](https://github.com/areirei/meilisearch-laravel-scout/wiki) of this repository!

🔧 Installation
--------------

[](#-installation)

### Install the Plugin

[](#install-the-plugin-)

```
composer require areirei/meilisearch-laravel-scout
```

### Install the HTTP Client

[](#install-the-http-client-)

You could use any [PSR-18](https://www.php-fig.org/psr/psr-18/) compatible client to use with this SDK. No additional configurations are required.
A list of compatible HTTP clients and client adapters can be found at [php-http.org](http://docs.php-http.org/en/latest/clients.html).

If you use **Laravel 8** you can skip this section as laravel pre-install Guzzle 7 by default.

Guzzle 7:

```
composer require guzzlehttp/guzzle
```

If you already have guzzle installed with a version &lt; 7, don't forget to update the version inside your composer.json

```
"require": {
  "guzzlehttp/guzzle": "^7.0"
}
```

Guzzle 6:

```
composer require php-http/guzzle6-adapter
```

Symfony Http Client:

```
composer require symfony/http-client nyholm/psr7
```

Curl:

```
composer require php-http/curl-client nyholm/psr7
```

### Export Configuration

[](#export-configuration-)

```
php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"
php artisan vendor:publish --provider="Meilisearch\Scout\MeilisearchServiceProvider" --tag="config"
```

### Update the `.env` file

[](#update-the-env-file-)

```
SCOUT_DRIVER=meilisearch
MEILISEARCH_HOST=http://127.0.0.1:7700
MEILISEARCH_KEY=masterKey
```

### Run MeiliSearch

[](#run-meilisearch-)

There are many easy ways to [download and run a MeiliSearch instance](https://docs.meilisearch.com/reference/features/installation.html#download-and-launch).

For example, if you use Docker:

```
docker run -it --rm -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey
```

NB: you can also download MeiliSearch from **Homebrew** or **APT**.

🚀 Getting Started
-----------------

[](#-getting-started)

### Indexes

[](#indexes)

#### Create an Index

[](#create-an-index-)

```
// Create an index
php artisan scout:index books
// Create an index and give the primary-key
php artisan scout:index books --key book_id
```

#### Add Documents

[](#add-documents-)

```
