PHPackages                             boomhq/laravel-scout-elastic - 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. boomhq/laravel-scout-elastic

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

boomhq/laravel-scout-elastic
============================

Elastic Driver for Laravel Scout

5.0.12(5y ago)030MITPHPPHP &gt;=5.6.4

Since Sep 20Pushed 5y agoCompare

[ Source](https://github.com/boomhq/laravel-scout-elastic)[ Packagist](https://packagist.org/packages/boomhq/laravel-scout-elastic)[ RSS](/packages/boomhq-laravel-scout-elastic/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (5)Versions (32)Used By (0)

Laravel Scout Elasticsearch Driver
==================================

[](#laravel-scout-elasticsearch-driver)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)![Status build](https://camo.githubusercontent.com/6612677ad3c07bcc443fe110f36955ec962a9e0ce90ab5781577e33ffbe677b3/68747470733a2f2f6170692e7472617669732d63692e6f72672f626f6f6d68712f6c61726176656c2d73636f75742d656c61737469632e7376673f6272616e63683d6d6173746572)

This package makes is the [Elasticsearch](https://www.elastic.co/products/elasticsearch) driver for Laravel Scout.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require boomhq/laravel-scout-elastic
```

You must add the Scout service provider and the package service provider in your app.php config:

```
// config/app.php
'providers' => [
    ...
    Laravel\Scout\ScoutServiceProvider::class,
    ...
    ScoutEngines\Elasticsearch\ElasticsearchProvider::class,
],
```

### Setting up Elasticsearch configuration

[](#setting-up-elasticsearch-configuration)

You must have a Elasticsearch server up and running with the index you want to use created

If you need help with this please refer to the [Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html)

After you've published the Laravel Scout package configuration:

```
// config/scout.php
// Set your driver to elasticsearch
    'driver' => env('SCOUT_DRIVER', 'elasticsearch'),

...
    'elasticsearch' => [
        'index' => env('ELASTICSEARCH_INDEX', 'laravel'),
        'hosts' => [
            env('ELASTICSEARCH_HOST', 'http://localhost'),
        ],
//set If one index per model (use searchableAs Methode) (defaut false)
        'perModelIndex' => true,
    ],
...
```

Usage
-----

[](#usage)

### Custom Index

[](#custom-index)

If you want to push a specific index you can declare `elasticsearchIndex() ` On your Model Before first Import (otherwise you need to delete index and reimport for create them) :

```
    public function elasticsearchIndex()
    {
        return  [
                  "settings" => [
                        "analysis" => [
                           "analyzer" => [
                              "default" => [
                                 "tokenizer" => "my_tokenizer",
                                 "filter" => [
                                    "lowercase"
                                 ]
                              ],
                              "default_search" => [
                                       "tokenizer" => "my_tokenizer"
                                    ]
                           ],
                           "tokenizer" => [
                                          "my_tokenizer" => [
                                             "type" => "edge_ngram",
                                             "min_gram" => 3,
                                             "max_gram" => 20,
                                             "token_chars" => [
                                                "letter"
                                             ],
                                             "filter" => [
                                                   "lowercase",
                                                   "asciifolding"
                                                ]
                                          ]
                                       ]
                        ],
                        "max_ngram_diff" => "20"
                     ]
               ];

    }
```

### Custom Query

[](#custom-query)

On Model you can specify custom query by :

```
 public function customScoutQuerySearching($terms): array
    {
        return [
            'query' => [
                'multi_match' => [
                    'query' => (string) ($terms),
                    'fields' => [
                        '*'
                    ],
                    'fuzziness' => 'AUTO',
                    'type' => 'most_fields'
                ]
            ],
        ];
    }
```

Now you can use Laravel Scout as described in the [official documentation](https://laravel.com/docs/5.3/scout)

Credits
-------

[](#credits)

- [Erick Tamayo](https://github.com/ericktamayo)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity69

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 ~45 days

Total

31

Last Release

2164d ago

Major Versions

1.0.1.x-dev → 2.0.02017-02-01

2.0.0 → 3.0.02017-02-01

2.0.1 → 3.0.82017-10-24

3.0.9 → 4.0.02018-10-15

4.0.0 → 5.0.02019-05-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c609189ec548303cb1c09df4705082769b2af311bda035075fe7a722b70e5aa?d=identicon)[boomhq](/maintainers/boomhq)

---

Top Contributors

[![ErickTamayo](https://avatars.githubusercontent.com/u/4788817?v=4)](https://github.com/ErickTamayo "ErickTamayo (22 commits)")[![boomhq](https://avatars.githubusercontent.com/u/10072713?v=4)](https://github.com/boomhq "boomhq (18 commits)")[![kronthto](https://avatars.githubusercontent.com/u/17156142?v=4)](https://github.com/kronthto "kronthto (5 commits)")[![xcaptain](https://avatars.githubusercontent.com/u/4054836?v=4)](https://github.com/xcaptain "xcaptain (2 commits)")[![shibby](https://avatars.githubusercontent.com/u/291643?v=4)](https://github.com/shibby "shibby (2 commits)")[![bbashy](https://avatars.githubusercontent.com/u/1149200?v=4)](https://github.com/bbashy "bbashy (2 commits)")[![BrianGreenhill](https://avatars.githubusercontent.com/u/1642339?v=4)](https://github.com/BrianGreenhill "BrianGreenhill (1 commits)")[![prajapatinirav](https://avatars.githubusercontent.com/u/7949561?v=4)](https://github.com/prajapatinirav "prajapatinirav (1 commits)")[![pvanhemmen](https://avatars.githubusercontent.com/u/715022?v=4)](https://github.com/pvanhemmen "pvanhemmen (1 commits)")[![semyonchetvertnyh](https://avatars.githubusercontent.com/u/2598761?v=4)](https://github.com/semyonchetvertnyh "semyonchetvertnyh (1 commits)")[![tillkruss](https://avatars.githubusercontent.com/u/665029?v=4)](https://github.com/tillkruss "tillkruss (1 commits)")[![clsource](https://avatars.githubusercontent.com/u/292738?v=4)](https://github.com/clsource "clsource (1 commits)")[![fridzema](https://avatars.githubusercontent.com/u/8180660?v=4)](https://github.com/fridzema "fridzema (1 commits)")

---

Tags

laravelelasticsearchelasticscout

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/boomhq-laravel-scout-elastic/health.svg)

```
[![Health](https://phpackages.com/badges/boomhq-laravel-scout-elastic/health.svg)](https://phpackages.com/packages/boomhq-laravel-scout-elastic)
```

###  Alternatives

[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

397612.3k](/packages/jeroen-g-explorer)

PHPackages © 2026

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