Configuring Elastic Search


The search utilities in Pyro run on top of Laravel's Scout package. This tutorial explains how to setup the Elastic Search driver.

Install Dependencies

composer require tamayo/laravel-scout-elastic:~2

Add ElasticSearch Driver Provider

Open /config/app.php and edit:

'providers' => [

Add ElasticSearch Configuration

Open /config/scout.php and edit:

'elasticsearch' => [
    'index' => env('ELASTICSEARCH_INDEX', 'laravel'),
    'config' => [
        'hosts' => [
            env('ELASTICSEARCH_HOST', 'localhost'),

Set 'elasticsearch' as your Scout Driver in .env file:


Additionally, specify your ElasticSearch host and index name:


Test by importing Model to ElasticSearch:

php artisan scout:import 'Anomaly\PostsModule\Post\PostModel'

No Comments

Please login to leave a comment.