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

Abandoned → [jeroen-g/explorer](/?search=jeroen-g%2Fexplorer)ArchivedLibrary[Search &amp; Filtering](/categories/search)

cfpinto/laravel-scout-elasticsearch
===================================

Laravel scout driver for ElasticSearch

v1.0.6(5y ago)22041GPL-3.0-or-laterPHPPHP &gt;=7.1.0

Since Oct 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/cfpinto/laravel-scout-elasticsearch)[ Packagist](https://packagist.org/packages/cfpinto/laravel-scout-elasticsearch)[ RSS](/packages/cfpinto-laravel-scout-elasticsearch/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (5)Versions (8)Used By (0)

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

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

**Disclaimer**: This project was highly inspired in [ErickTamayo](https://github.com/ErickTamayo/laravel-scout-elastic) implementation. However it is not a fork and most likely is incompatible.

This package is intented to be used with laravel 5.6 and up. Others versions might work but might

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

[](#installation)

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

If your project doesn't have auto discovery you will need to add the providers manually in your app.php config file

```
'providers' => [
	...
	Laravel\Scout\ScoutServiceProvider::class,
	...
	ScoutEngines\Elasticsearch\ElasticsearchProvider::class
],
```

### Setup Elasticsearch configuration

[](#setup-elasticsearch-configuration)

You must have an Elasticsearch instance running with the necessary index.

Change the config/scout.php file to include elasticsearch settings

```
// 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)

The driver will work just like described in laravel scout [documentation](https://laravel.com/docs/5.5/scout).

If you want the ability to use closures in where and orWhere methods your model must use the Searchable trait included in the package

```
