Created
November 23, 2016 17:04
-
-
Save threesquared/65f90c5dda7f6a6fd1afbb6b5089b4ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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