PHPackages                             bittenbyte/laravel-scout-elasticsearch - 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. bittenbyte/laravel-scout-elasticsearch

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

bittenbyte/laravel-scout-elasticsearch
======================================

ElasticSearch Custom Engine for Laravel Scout

212PHP

Since Mar 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/BittenByte/laravel-scout-elasticsearch)[ Packagist](https://packagist.org/packages/bittenbyte/laravel-scout-elasticsearch)[ RSS](/packages/bittenbyte-laravel-scout-elasticsearch/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Scout ElasticSearch engine
==================================

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

An ElasticSearch Custom Engine implementation for Laravel Scout (3.\*)

*IMPORTANT* this is still an experimental package!!!

Instalation
-----------

[](#instalation)

Install the package via composer:

```
composer require bittenbyte/laravel-scout-elasticsearch

```

Add the service provider to the providers section in the config/app.php (of course you need Scout too)

```
    ...
    BittenByte\ScoutElasticsearchEngine\ScoutElasticsearchEngineServiceProvider::class,
    ...

```

In the config/scout.php set the driver properly and add a key as per below:

```
    ...
    'driver' => 'elasticsearch',
    ...
    'elasticsearch' => [
        'config' => [
            'hosts' => array_map('trim', explode(',', env('ELASTICSEARCH_HOSTS', 'localhost'))),
        ],
        //default searchable fields per index
        'fields' => [
            'users_index' => [
                'name', 'email', 'role', 'slug',
            ],
        ],
        'indices' => [
            //set your OPTIONAL index specific settings and mappings
            'users_index' => [
                'settings' => [
                    'number_of_shards' => 3,
                    'number_of_replicas' => 2
                ],
                'mappings' => [
                    'authenticable' => [
                        '_source' => [
                            'enabled' => true,
                        ],
                        'properties' => [
                            'name' => [
                                'type' => 'string',
                                'index' => 'not_analyzed',
                            ],
                            'slug' => [
                                'type' => 'string',
                                'index' => 'not_analyzed',
                            ],
                            'role' => [
                                'type' => 'string',
                                'index' => 'not_analyzed',
                            ],
                            'email' => [
                                'type' => 'string',
                                'index' => 'not_analyzed',
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

```

Usage
-----

[](#usage)

Follow this documentation below and the official docs for scout

TO-DO (docs)
------------

[](#to-do-docs)

Advanced/Custom query builder

Documentation
-------------

[](#documentation)

Not to forget from Scout docs

indexation is automaticaly hooked to Eloquent create, update and (soft)delete operations

Also is possible to index/remove from index manually

```
// Updating via Eloquent query...
App\Order::where('price', '>', 100)->searchable();

// You may also update via relationships...
$user->orders()->searchable();

// You may also update via collections...
$orders->searchable();

```

```
// Removing via Eloquent query...
App\Order::where('price', '>', 100)->unsearchable();

// You may also remove via relationships...
$user->orders()->unsearchable();

// You may also remove via collections...
$orders->unsearchable();

```

### Pausing Indexing

[](#pausing-indexing)

This is useful specially when doing batch operations

```
App\Order::withoutSyncingToSearch(function () {
    // Perform model actions...
});

```

### Search (try out in tinker)

[](#search-try-out-in-tinker)

```
$orders = App\Order::search('Star Trek')->get();

```

### Where clauses (only id). Weird concept (NoSQL and sql wheres?)

[](#where-clauses-only-id-weird-concept-nosql-and-sql-wheres)

```
$orders = App\Order::search('Star Trek')->where('user_id', 1)->get();

```

### Pagination

[](#pagination)

```
$orders = App\Order::search('Star Trek')->paginate();

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

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

---

Top Contributors

[![jhmilan](https://avatars.githubusercontent.com/u/19405?v=4)](https://github.com/jhmilan "jhmilan (2 commits)")

### Embed Badge

![Health badge](/badges/bittenbyte-laravel-scout-elasticsearch/health.svg)

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

###  Alternatives

[ruflin/elastica

Elasticsearch Client

2.3k50.4M203](/packages/ruflin-elastica)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M65](/packages/opensearch-project-opensearch-php)[mailerlite/laravel-elasticsearch

An easy way to use the official PHP ElasticSearch client in your Laravel applications.

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[massive/search-bundle

Massive Search Bundle

721.4M13](/packages/massive-search-bundle)[outl1ne/nova-multiselect-filter

Multiselect filter for Laravel Nova.

45802.7k3](/packages/outl1ne-nova-multiselect-filter)[handcraftedinthealps/zendsearch

a general purpose text search engine written entirely in PHP 5

39921.0k35](/packages/handcraftedinthealps-zendsearch)

PHPackages © 2026

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