Laravel Scout Elasticsearch: integrate ElasticSearch into our Laravel app easily
The package provides the perfect starting point to integrate ElasticSearch into your Laravel application.
Features
Search amongst multiple models
Zero downtime reimport - it’s a breeze to import data in production.
Import all searchable models at once.
A fully configurable mapping for each model.
Full power of ElasticSearch in your queries.
⚠️ Requirements
PHP version >= 7.1.3
Laravel Framework version >= 5.6
Elasticsearch version >= 6
Installation
Use composer to install the package:
composer require matchish/laravel-scout-elasticsearch
Set env variables
SCOUT_DRIVER=Matchish\ScoutElasticSearch\Engines\ElasticSearchEngine
The package uses \ElasticSearch\Client from official package, but does not try to configure it, so feel free do it in your app service provider. But if you don't want to do it right now, you can use Matchish\ElasticSearchServiceProvider from the package. Register the provider, adding to config/app.php
'providers' => [
// Other Service Providers
\Matchish\ScoutElasticSearch\ElasticSearchServiceProvider::class
],
Set ELASTICSEARCH_HOST env variable
ELASTICSEARCH_HOST=host:port
And publish config example for elasticsearch
php artisan vendor:publish --tag config
Source Code
https://github.com/matchish/laravel-scout-elasticsearch/tree/elasticsearch-7
This post is submitted by our members. Submit a new post.
Tags: Tutorials Packages Sources Laravel 5.8 Laravel 5.7 Laravel 5.6 Laravel 5.5 Laravel 5.4 Laravel 5 Beginner