PHPackages                             jeroen-g/explorer - 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. jeroen-g/explorer

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

jeroen-g/explorer
=================

Next-gen Elasticsearch driver for Laravel Scout.

4.4.0(1mo ago)397612.3k↓19.1%72[10 issues](https://github.com/Jeroen-G/Explorer/issues)[4 PRs](https://github.com/Jeroen-G/Explorer/pulls)MITPHPPHP ^8.2CI passing

Since Oct 31Pushed 1mo ago7 watchersCompare

[ Source](https://github.com/Jeroen-G/Explorer)[ Packagist](https://packagist.org/packages/jeroen-g/explorer)[ Docs](https://jeroen-g.github.io/Explorer/)[ RSS](/packages/jeroen-g-explorer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (26)Versions (41)Used By (0)

Explorer
========

[](#explorer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9736a2aae650d1e91c45f4e6f2da1145ade02b517f3935416c973b3a733e45ca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a65726f656e2d672f6578706c6f7265722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeroen-g/explorer)

[![CI](https://github.com/Jeroen-G/Explorer/actions/workflows/ci.yml/badge.svg)](https://github.com/Jeroen-G/Explorer/actions/workflows/ci.yml)

Next-gen Elasticsearch driver for Laravel Scout with the power of Elasticsearch's queries.

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

[](#installation)

Via Composer

```
composer require jeroen-g/explorer
```

You will need the configuration file to define your indexes:

```
php artisan vendor:publish --tag=explorer.config
```

Also do not forget to follow the [installation instructions for Laravel Scout](https://laravel.com/docs/scout#installation), and in your Laravel Scout config, set the driver to `elastic`.

Usage
-----

[](#usage)

Be sure to also have a look at the [docs](docs/index.md) to see what is possible! There is also a [demo app](https://github.com/Jeroen-G/explorer-demo) available that might be insightful.

### Configuration

[](#configuration)

You may either define the mapping for you index in the config file:

```
return [
    'indexes' => [
        'posts_index' => [
            'properties' => [
                'id' => 'keyword',
                'title' => 'text',
            ],
        ]
    ]
];
```

Or you may define the model for the index, and the rest will be decided for you:

```
return [
    'indexes' => [
        \App\Models\Post::class
    ],
];
```

In the last case you may implement the `Explored` interface and overwrite the mapping with the `mappableAs()` function.

Essentially this means that it is up to you whether you like having it all together in the model, or separately in the config file.

### Advanced queries

[](#advanced-queries)

The documentation of Laravel Scout states that "more advanced "where" clauses are not currently supported". Only a simple check for ID is possible besides the standard fuzzy term search:

```
$posts = Post::search('lorem ipsum')->get();
```

Explorer expands your possibilities using query builders to write more complex queries.

For example, to get all posts that:

- are published
- have "lorem" somewhere in the document
- have "ipsum" in the title
- maybe have a tag "featured", if so boost its score by 2

You could execute this search query:

```
$posts = Post::search('lorem')
    ->must(new Matching('title', 'ipsum'))
    ->should(new Terms('tags', ['featured'], 2))
    ->filter(new Term('published', true))
    ->get();
```

### Commands

[](#commands)

Be sure you have configured your indexes first in `config/explorer.php` and run the Scout commands.

#### Searching indexes

[](#searching-indexes)

```
php artisan elastic:search "App\Models\Post" lorem
```

Changelog
---------

[](#changelog)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Jeroen](https://github.com/jeroen-g)
- [Vincent](https://github.com/blackshadev)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

68

—

FairBetter than 100% of packages

Maintenance88

Actively maintained with recent releases

Popularity59

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 64.5% 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 ~53 days

Recently: every ~110 days

Total

38

Last Release

55d ago

Major Versions

v1.2.0 → v2.0.02021-05-07

2.5.1 → 3.0.02022-03-11

2.6.0 → 3.2.02022-07-08

3.15.0 → 4.0.02025-01-05

PHP version history (5 changes)v1.0.0PHP ^7.4|^8.0

3.0.0PHP 8.0.\*||8.1.\*

3.4.0PHP 8.0.\*||8.1.\*||8.2.\*

3.11.0PHP 8.0.\*||8.1.\*||8.2.\*||8.3.\*

4.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d8700d69abe733de151f8cf49084e99ded7b9d34d7b0d1cd8f3825f5d925ff3?d=identicon)[JeroenG](/maintainers/JeroenG)

---

Top Contributors

[![Jeroen-G](https://avatars.githubusercontent.com/u/1116853?v=4)](https://github.com/Jeroen-G "Jeroen-G (312 commits)")[![blackshadev](https://avatars.githubusercontent.com/u/2979104?v=4)](https://github.com/blackshadev "blackshadev (80 commits)")[![a-drew](https://avatars.githubusercontent.com/u/6550234?v=4)](https://github.com/a-drew "a-drew (14 commits)")[![ert485](https://avatars.githubusercontent.com/u/6201488?v=4)](https://github.com/ert485 "ert485 (10 commits)")[![4ice](https://avatars.githubusercontent.com/u/6935261?v=4)](https://github.com/4ice "4ice (7 commits)")[![askdkc](https://avatars.githubusercontent.com/u/7894265?v=4)](https://github.com/askdkc "askdkc (6 commits)")[![AiAe](https://avatars.githubusercontent.com/u/3695158?v=4)](https://github.com/AiAe "AiAe (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![enrise-mbraam](https://avatars.githubusercontent.com/u/118975804?v=4)](https://github.com/enrise-mbraam "enrise-mbraam (4 commits)")[![jackbayliss](https://avatars.githubusercontent.com/u/13621738?v=4)](https://github.com/jackbayliss "jackbayliss (4 commits)")[![Ar0010r](https://avatars.githubusercontent.com/u/47714178?v=4)](https://github.com/Ar0010r "Ar0010r (4 commits)")[![JakubMerkandi](https://avatars.githubusercontent.com/u/145023659?v=4)](https://github.com/JakubMerkandi "JakubMerkandi (4 commits)")[![quintenbuis](https://avatars.githubusercontent.com/u/36452184?v=4)](https://github.com/quintenbuis "quintenbuis (3 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (3 commits)")[![bartjuh4](https://avatars.githubusercontent.com/u/245335?v=4)](https://github.com/bartjuh4 "bartjuh4 (2 commits)")[![Flythe](https://avatars.githubusercontent.com/u/225417?v=4)](https://github.com/Flythe "Flythe (2 commits)")[![Lucasmeteenc](https://avatars.githubusercontent.com/u/47983556?v=4)](https://github.com/Lucasmeteenc "Lucasmeteenc (2 commits)")[![seunghaekim-znjadong](https://avatars.githubusercontent.com/u/137516572?v=4)](https://github.com/seunghaekim-znjadong "seunghaekim-znjadong (2 commits)")[![Thomas-Xefi](https://avatars.githubusercontent.com/u/114469558?v=4)](https://github.com/Thomas-Xefi "Thomas-Xefi (2 commits)")[![fan711](https://avatars.githubusercontent.com/u/13937640?v=4)](https://github.com/fan711 "fan711 (1 commits)")

---

Tags

elasticsearchhacktoberfestlaravelsearchlaravelelasticsearchelasticexplorerscout

###  Code Quality

TestsPHPUnit

Code StyleECS

### Embed Badge

![Health badge](/badges/jeroen-g-explorer/health.svg)

```
[![Health](https://phpackages.com/badges/jeroen-g-explorer/health.svg)](https://phpackages.com/packages/jeroen-g-explorer)
```

PHPackages © 2026

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