Skip to content

Instantly share code, notes, and snippets.

@threesquared
Created November 23, 2016 17:04
Show Gist options
  • Save threesquared/65f90c5dda7f6a6fd1afbb6b5089b4ec to your computer and use it in GitHub Desktop.
Save threesquared/65f90c5dda7f6a6fd1afbb6b5089b4ec to your computer and use it in GitHub Desktop.
<?php
namespace App\Services;
use Aws\Credentials\CredentialProvider;
use Aws\Credentials\Credentials;
use Aws\ElasticsearchService\ElasticsearchPhpHandler;
use Elasticsearch\ClientBuilder;
use Laravel\Scout\Engines\ElasticsearchEngine;
class SignedElasticsearchEngine extends ElasticsearchEngine
{
/**
* Create a new signed elasticsearch engine instance
*/
public function __construct()
{
$handler = new ElasticsearchPhpHandler('eu-west-1');
$elasticsearch = ClientBuilder::create()
->setHandler($handler)
->setHosts(config('scout.elasticsearch.config.hosts'))
->build();
$this->elasticsearch = $elasticsearch;
$this->index = config('scout.elasticsearch.index');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment