PHPackages                             brokerexchange/elasticscout - 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. brokerexchange/elasticscout

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

brokerexchange/elasticscout
===========================

Laravel Scout Driver for Elasticsearch 6 and 7

v10.1.0(6y ago)177946[1 PRs](https://github.com/BrokerExchange/ElasticScout/pulls)MITPHP

Since Feb 1Pushed 1y ago6 watchersCompare

[ Source](https://github.com/BrokerExchange/ElasticScout)[ Packagist](https://packagist.org/packages/brokerexchange/elasticscout)[ Docs](http://brokerexchange.github.io/ElasticScout/)[ RSS](/packages/brokerexchange-elasticscout/feed)WikiDiscussions 10.0 Synced 2mo ago

READMEChangelog (10)Dependencies (2)Versions (43)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/4c6602c6e01b215df7bbb71b974cd9d31b658a9d6bf57393351499b56113bab7/68747470733a2f2f706f7365722e707567782e6f72672f62726f6b657265786368616e67652f656c617374696373636f75742f762f737461626c65)](https://packagist.org/packages/brokerexchange/elasticscout)[![Latest Unstable Version](https://camo.githubusercontent.com/cd42de3bc90912abcbb1df4ffd6adfd5341fdf912845abbdb089eb1be27f3820/68747470733a2f2f706f7365722e707567782e6f72672f62726f6b657265786368616e67652f656c617374696373636f75742f762f756e737461626c65)](https://packagist.org/packages/brokerexchange/elasticscout)[![Total Downloads](https://camo.githubusercontent.com/94a37ecc474bdbb7c223c7e877555dac2df856ed147ab04bd06905833b000eed/68747470733a2f2f706f7365722e707567782e6f72672f62726f6b657265786368616e67652f656c617374696373636f75742f646f776e6c6f616473)](https://packagist.org/packages/brokerexchange/elasticscout)[![License](https://camo.githubusercontent.com/59416e44bfed082e17d16dbb4f4922a434b93b78aa9b49232d66f826894d33d2/68747470733a2f2f706f7365722e707567782e6f72672f62726f6b657265786368616e67652f656c617374696373636f75742f6c6963656e7365)](https://packagist.org/packages/brokerexchange/elasticscout)[![composer.lock](https://camo.githubusercontent.com/9caaf3e2b22873706fb7809763e1cfd00ce6f373dca21c55db358192de295f2c/68747470733a2f2f706f7365722e707567782e6f72672f62726f6b657265786368616e67652f656c617374696373636f75742f636f6d706f7365726c6f636b)](https://packagist.org/packages/brokerexchange/elasticscout)

ElasticScout
============

[](#elasticscout)

A [Laravel Scout](https://github.com/laravel/scout) Driver for Elasticsearch 6

Overview
--------

[](#overview)

ElasticScout is a [Laravel Scout](https://github.com/laravel/scout) Elasticsearch 6 compatible engine. It makes critical changes to the old Elasticseach Scout Engine, as well as adds new functionality.

The ElasticScout engine includes an Elasticsearch Query Builder which can be used to create elaborate custom queries and aggregations, allowing full use of Elasticsearch within the Laravel/Scout Paradigm.

License
-------

[](#license)

ElasticScout is released under the MIT Open Source License,

Copyright
---------

[](#copyright)

ElasticScout © Broker Exchange Network 2018

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

[](#installation)

- Run composer require command `composer require brokerexchange/elasticscout`
- Configure Elasticsearch Host (default: localhost:9200)

```
   ELASTICSEARCH_HOST='elastic1.host.com:9200,elastic2.host.com:9200'
```

- Add trait to desired model

```
   use ElasticScout\Searchable;
```

Usage
-----

[](#usage)

```
   //create search/query object
   $search = $article->search()
       ->boolean()
       ->should(DSL::match('title',$request->input('query')))
       ->should(DSL::match('body',$request->input('query')))
       ->highlight(['body','title'])
       ->filter(DSL::term('published', 1))
       ->aggregate(Agg::terms('categories', 'category.name'));

   //fire the search
   $articles = $search->paginate();

   //retrieve aggregation results
   $categories = $search->aggregation('categories');

   //retrieve highlight results for title field of first result article
   $firstArticleTitleHighlights = $articles->first()->highlight('title');

```

Mappings
--------

[](#mappings)

You may set a custom mapping by simply defining a "mapping" method on your model.

```
   public function mappings()
   {
       return [
           $this->searchableType() => [
               'properties' => [
                   'name' => [
                       'type' => 'text',
                       'fields' => [
                           'keyword' => [
                               'type' => 'keyword',
                           ],
                           'autocomplete' => [
                               'type' => 'text',
                               'analyzer' => 'autocomplete',
                               'search_analyzer' => 'autocomplete_search',
                           ],
                       ],
                   ],
               ]
           ]
       ]
   }
```

Settings
--------

[](#settings)

You may create custom settings and analyzers by creating a "settings" method on the model.

```
   public function settings()
   {
     return [
         'index' => [
             'analysis' => [
                 'analyzer' => [
                     'autocomplete' => [
                         'tokenizer' => 'autocomplete',
                         'filter' => [
                             'lowercase',
                         ],
                     ],
                     'autocomplete_search' => [
                         'tokenizer' => 'lowercase',
                     ],
                 ],
                 'tokenizer' => [
                     'autocomplete' => [
                         'type' => 'edge_ngram',
                         'min_gram' => 1,
                         'max_gram' => 15,
                         'token_chars' => [
                             'letter'
                         ]
                     ]
                 ]
             ],
         ],
     ];
   }
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 92% of commits — single point of failure

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

Recently: every ~62 days

Total

42

Last Release

2461d ago

Major Versions

5.0.x-dev → v6.0.02017-09-01

6.0.x-dev → v7.0.02017-11-29

7.0.x-dev → v8.0.02018-02-12

8.0.x-dev → v9.0.02018-11-20

9.0.x-dev → v10.0.02019-02-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/fc511d79233a52b0bb85db90dcac069b3482399e1a6778acfd1825092a2de9cb?d=identicon)[Artistan](/maintainers/Artistan)

![](https://www.gravatar.com/avatar/3b3300a4dbc020ca5bfd2b46fed9a29f51d4c78dd982fc9ab72e1cb6e02098f6?d=identicon)[brino](/maintainers/brino)

![](https://avatars.githubusercontent.com/u/2651603?v=4)[Sean Wahlstrom](/maintainers/SeanWahlstrom)[@SeanWahlstrom](https://github.com/SeanWahlstrom)

---

Top Contributors

[![brino](https://avatars.githubusercontent.com/u/986822?v=4)](https://github.com/brino "brino (92 commits)")[![SeanWahlstrom](https://avatars.githubusercontent.com/u/2651603?v=4)](https://github.com/SeanWahlstrom "SeanWahlstrom (5 commits)")[![Artistan](https://avatars.githubusercontent.com/u/801349?v=4)](https://github.com/Artistan "Artistan (2 commits)")[![llz](https://avatars.githubusercontent.com/u/2305311?v=4)](https://github.com/llz "llz (1 commits)")

---

Tags

elasticsearchelasticsearch-query-dsllaravel-scoutphpquery-buildersearchlaravelelasticsearchscout

### Embed Badge

![Health badge](/badges/brokerexchange-elasticscout/health.svg)

```
[![Health](https://phpackages.com/badges/brokerexchange-elasticscout/health.svg)](https://phpackages.com/packages/brokerexchange-elasticscout)
```

###  Alternatives

[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

397612.3k](/packages/jeroen-g-explorer)[matchish/laravel-scout-elasticsearch

Search among multiple models with ElasticSearch and Laravel Scout

7431.6M2](/packages/matchish-laravel-scout-elasticsearch)

PHPackages © 2026

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