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

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

novius/laravel-scout-elasticsearch-driver
=========================================

Elasticsearch Driver for Laravel Scout

5.0.0(11mo ago)59.7k↓22.7%4MITPHPPHP ^8.2CI passing

Since Jan 8Pushed 11mo ago3 watchersCompare

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

READMEChangelog (6)Dependencies (7)Versions (12)Used By (0)

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

[](#scout-elasticsearch-driver)

[![Novius CI](https://github.com/novius/laravel-scout-elasticsearch-driver/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/novius/laravel-scout-elasticsearch-driver/actions/workflows/main.yml)[![Packagist Release](https://camo.githubusercontent.com/8ebca62e923be09122f214c67015292c4cf46c204d7313e6dc786a699358e725/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f766975732f6c61726176656c2d73636f75742d656c61737469637365617263682d6472697665722e7376673f6d61784167653d31383030267374796c653d666c61742d737175617265)](https://packagist.org/packages/novius/laravel-scout-elasticsearch-driver)[![Licence](https://camo.githubusercontent.com/440b6f9260bb108e4e7b4597723c7316ad2d7d3e02f3cd3aa4247f912fdfdee5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6e6f766975732f6c61726176656c2d73636f75742d656c61737469637365617263682d6472697665722e7376673f6d61784167653d31383030267374796c653d666c61742d737175617265)](https://github.com/novius/laravel-scout-elasticsearch-driver#licence)

This package is an adaptation of [babenkoivan/scout-elasticsearch-driver ](https://github.com/babenkoivan/scout-elasticsearch-driver) to get working with Elasticsearch &gt;= 7.0.0

This package version was created to be compatible with [Elasticsearch "Removal of mapping types"](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/removal-of-types.html#removal-of-types) introduced in Elasticsearch &gt;= 7.0.0

Features added
--------------

[](#features-added)

- Model's type is now saved in `type` field by default according to [Elasticsearch recommendations](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/removal-of-types.html#_custom_type_field)
- After a model search, an attribute `_score` will be hydrated on your result Model.

Example :

```
$results = MyModel::search('keywords')->get();
foreach ($results as $result) {
    // Score is now available in : $result->_score
}
```

- Logs : you can now use Laravel loggers to log ElasticSearch's requests

To enable logs you have to set `SCOUT_ELASTIC_LOG_ENABLED` to `true` and specify which log's channel(s) to use.

Example :

***config/logging.php***

```
