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

ActiveLibrary

crasmedia/laravel-scout-elastic
===============================

Elastic Driver for Laravel Scout

3.0.2(9y ago)6241PHPPHP &gt;=5.6.4

Since Sep 29Pushed 9y ago2 watchersCompare

[ Source](https://github.com/Crasmedia/laravel-scout-elastic)[ Packagist](https://packagist.org/packages/crasmedia/laravel-scout-elastic)[ RSS](/packages/crasmedia-laravel-scout-elastic/feed)WikiDiscussions 3.0 Synced 2mo ago

READMEChangelog (1)DependenciesVersions (6)Used By (0)

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

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

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

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 Crasmedia/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'),
        ],
    ],
...
```

Usage
-----

[](#usage)

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

Custom modifications
--------------------

[](#custom-modifications)

You can create/delete your own indexes and put custom mappings on it

```
$index = config('scout.elasticsearch.index');

// Check if index exists
if($model->searchableUsing()->exists($index))
{
    // Delete index if exists
    $model->searchableUsing()->deleteIndex($index);
}

// Create new index
$model->searchableUsing()->createIndex($index);

// Put custom mapping
$mappings = $model->mapping();
$model->searchableUsing()->putMapping($index, $model->getTable(), $mappings);
```

For using the custom mapping just add a mapping function to your model

```
public function mapping()
{
    $mapping = [
        'title' => [
            'type' => 'keyword'
        ]
    ];

    return $mapping;
}
```

Boost
-----

[](#boost)

If you wanna boost some fields, just add a boosts variable to your model

```
protected $boosts = [
    'title' => 2
];
```

[More information on elastic site](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html)

Sort
----

[](#sort)

Just use the eloquent order by function

```
Model::search('')->orderBy('title', 'asc')->get()
```

Credits
-------

[](#credits)

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

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 61.8% 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 ~26 days

Recently: every ~2 days

Total

6

Last Release

3378d ago

Major Versions

1.0.1 → 2.0.02017-02-01

2.0.0 → 3.0.02017-02-01

### Community

---

Top Contributors

[![ErickTamayo](https://avatars.githubusercontent.com/u/4788817?v=4)](https://github.com/ErickTamayo "ErickTamayo (21 commits)")[![roetker](https://avatars.githubusercontent.com/u/9840132?v=4)](https://github.com/roetker "roetker (5 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)")[![tillkruss](https://avatars.githubusercontent.com/u/665029?v=4)](https://github.com/tillkruss "tillkruss (1 commits)")[![BrianGreenhill](https://avatars.githubusercontent.com/u/1642339?v=4)](https://github.com/BrianGreenhill "BrianGreenhill (1 commits)")[![fridzema](https://avatars.githubusercontent.com/u/8180660?v=4)](https://github.com/fridzema "fridzema (1 commits)")[![pvanhemmen](https://avatars.githubusercontent.com/u/715022?v=4)](https://github.com/pvanhemmen "pvanhemmen (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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