ijuniorfu/laravel-scout-elasticsearch

Elastic Driver for Laravel Scout

v7.6 2020-04-08 01:55 UTC

This package is auto-updated.

Last update: 2024-04-08 10:50:13 UTC


README

Software License This package makes is the Elasticsearch driver for Laravel Scout.

Contents

Installation

You can install the package via composer:

composer require ijuniorfu/laravel-scout-elasticsearch

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

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

After you've published the Laravel Scout package configuration:

// config/scout.php
// Set your driver to elasticsearch
    'driver' => env('SCOUT_DRIVER', 'elasticsearch'),

...
    'elasticsearch' => [
        'type' => env('ELASTICSEARCH_TYPE', '_doc'),
        'hosts' => [
            env('ELASTICSEARCH_HOST', 'http://localhost'),
        ],
    ],
...

Usage

Now you can use Laravel Scout as described in the official documentation

License

The MIT License (MIT).