2017 © Pedro Peláez
 

library laravel-scout-elastic

Elastic Driver for Laravel Scout (with AWS IAM capability)

image

mobilexco/laravel-scout-elastic

Elastic Driver for Laravel Scout (with AWS IAM capability)

  • Sunday, July 1, 2018
  • by adamgoucher
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 138 Forks
  • 0 Open issues
  • 20 Versions
  • 0 % Grown

The README.md

Laravel Scout Elasticsearch Driver

Software License, (*1)

This package makes is the Elasticsearch driver for Laravel Scout that works with AWS' Elasticsearch and does not require you to put credentials into .env files., (*2)

Contents

Installation

You can install the package via composer:, (*3)

``` bash composer require tamayo/laravel-scout-elastic, (*4)


You must add the Scout service provider and the package service provider in your app.php config: ```php // config/app.php 'providers' => [ ... Laravel\Scout\ScoutServiceProvider::class, ... ScoutEngines\Elasticsearch\ElasticsearchProvider::class, ],

Configuration

This package assumes you are following good AWS security and /not/ putting password in your Laravel .env files an instead follows the practices outlined in Credentials for the AWS SDK for PHP Version 3. To enable this, set the following variable in your .env., (*5)

ELASTICSEARCH_PROVIDER=aws

For local development, inside vagrant for instance, you can use the normal Elasticsearch client by either omitting this variable or setting it as follows., (*6)

ELASTICSEARCH_PROVIDER=elastic

One thing the AWS client needs is the Region. If you don't already have it in your .env, add it as such., (*7)

AWS_REGION=us-west-2

Testing with Scout

If your CI environment does not have access to a working Elasticsearch instance, any indexed Models will cause it to error. To solve this, add the following to your phpunit.xml. The single quotes wrapping the double quotes are the tricky part there., (*8)

<env name="SCOUT_DRIVER" value='"null"' />

Laravel Configuration

After you've published the Laravel Scout package configuration, (*9)

php artisan vendor:publish  --provider="ScoutEngines\Elasticsearch\ElasticsearchProvider"

you'll need to update the main scout configuration, (*10)

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

...
    'elasticsearch' => [
        'index' => [
            // if using more than one index, you likely want to change this to each of
            // your indexes. quite possibly using searchableAs on your models.
            env('ELASTICSEARCH_INDEX', 'scout')
        ],
        'hosts' => [
            env('ELASTICSEARCH_HOST', 'http://localhost'),
        ],
        'perModelIndex' => true,
    ],
...

and this package's configuration, (*11)

// config/laravel-scout-elastic
// set this if you don't want to include it in your .env
    'provider' => env('ELASTICSEARCH_PROVIDER', 'elasticsearch'),
...
    'region' => env('AWS_REGION', 'us-west-2'),
...

and enable the artisan job:, (*12)

// App/Console/Kernel.php
protected $commands = [
    ...
    \App\Console\Commands\CreateIndex::class
    ...
],

Elasticsearch Configuration

Scout will happily throw an error if it cannot create contact your Elasticsearch server or the index doesn't exist., (*13)

Creating an index can be kinda arcane, so if the index doesn't exist, you can include the following artisan command in your deployment stack to check if the index exists, and if it doesnt then it will create it., (*14)

php artisan scout:create-index

Usage

Now you can use Laravel Scout as described in the official documentation, (*15)

Credits

License

The MIT License (MIT)., (*16)

The Versions

01/07 2018

dev-master

9999999-dev

Elastic Driver for Laravel Scout (with AWS IAM capability)

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch aws elastic scout

01/07 2018

4.0.0

4.0.0.0

Elastic Driver for Laravel Scout (with AWS IAM capability)

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch aws elastic scout

22/04 2018

3.0.9

3.0.9.0

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

24/10 2017

3.0.8

3.0.8.0

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

13/10 2017

2.0.x-dev

2.0.9999999.9999999-dev

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

13/10 2017

2.0.1

2.0.1.0

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

28/09 2017

3.0.7

3.0.7.0

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

21/08 2017

3.0.6

3.0.6.0

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

08/08 2017

3.0.5

3.0.5.0

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

02/07 2017

3.0.4

3.0.4.0

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

24/04 2017

3.0.3

3.0.3.0

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

01/04 2017

3.0.2

3.0.2.0

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

02/02 2017

3.0.x-dev

3.0.9999999.9999999-dev

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

02/02 2017

3.0.1

3.0.1.0

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

01/02 2017

3.0.0

3.0.0.0

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

01/02 2017

2.0.0

2.0.0.0

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

29/09 2016

1.0.0.x-dev

1.0.0.9999999-dev

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

29/09 2016

1.0.1.x-dev

1.0.1.9999999-dev

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

29/09 2016

1.0.1

1.0.1.0

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout

20/09 2016

0.0.1.x-dev

0.0.1.9999999-dev

Elastic Driver for Laravel Scout

  Sources   Download

The Requires

 

The Development Requires

laravel elasticsearch elastic scout