PHPackages                             tjn/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. tjn/elastic

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

tjn/elastic
===========

Elastic Driver for Laravel Scout

1.0.0(7y ago)013MITPHPPHP &gt;=5.6.4

Since Jul 27Pushed 7y agoCompare

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

READMEChangelog (1)Dependencies (5)Versions (2)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 lanzhanqiao/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)

1. 如果你想使用`highlight`,在你的model中引入ScoutEngines\\Elasticsearch\\EsHighlight特性
2. es的index在model中通过方法esIndex动态设置，如果没有则取scout配置文件中的默认index

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

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2896d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7269a5ccf967c0f029f2c93c67081c47216a53bd4564f0cf5d6a2ca5f6778b48?d=identicon)[Kanin](/maintainers/Kanin)

---

Top Contributors

[![tangccy](https://avatars.githubusercontent.com/u/12172453?v=4)](https://github.com/tangccy "tangccy (1 commits)")

---

Tags

laravelelasticsearchelasticscout

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tjn-elastic/health.svg)

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

###  Alternatives

[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

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

PHPackages © 2026

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