Skip to content

Commit

Permalink
Add AWS configuration examples (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingimmick authored Sep 6, 2023
1 parent 826f65b commit e8e8d3b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Laravel Scout OpenSearch

<p align="center">
<a href="https://github.com/zingimmick/laravel-scout-opensearch/actions"><img src="https://github.com/zingimmick/laravel-scout-opensearch/actions/workflows/tests.yml/badge.svg" alt="Build Status"></a>
<a href="https://codecov.io/gh/zingimmick/laravel-scout-opensearch"><img src="https://codecov.io/gh/zingimmick/laravel-scout-opensearch/branch/3.x/graph/badge.svg" alt="Code Coverage" /></a>
Expand Down Expand Up @@ -53,6 +54,40 @@ class SearchableModel extends Model
}
```

### Configuration for Amazon OpenSearch Service

```php
return [
// ...
'opensearch' => [
'hosts' => [env('OPENSEARCH_HOST', 'localhost:9200')],
'basicAuthentication' => [env('OPENSEARCH_USERNAME', 'admin'), env('OPENSEARCH_PASSWORD', 'admin')],
'retries' => env('OPENSEARCH_RETRYS', 2),
'sigV4Region' => env('OPENSEARCH_REGION', 'us-east-1') ,
'sigV4Service' => env('OPENSEARCH_SERVICE', 'es') ,
'sigV4CredentialProvider' => [
'key' => env('OPENSEARCH_IAM_KEY'),
'secret' => env('OPENSEARCH_IAM_SECRET'),
],
],
];
```

### Debug and logging

```php
return [
// ...
'opensearch' => [
'hosts' => [env('OPENSEARCH_HOST', 'localhost:9200')],
'basicAuthentication' => [env('OPENSEARCH_USERNAME', 'admin'), env('OPENSEARCH_PASSWORD', 'admin')],
'retries' => env('OPENSEARCH_RETRYS', 2),
'logger' => (new \Monolog\Logger('opensearch'))->pushHandler(new \Monolog\Handler\RotatingFileHandler('opensearch.log')),
'tracer' => (new \Monolog\Logger('opensearch'))->pushHandler(new \Monolog\Handler\RotatingFileHandler('opensearch.log')),
],
];
```

## License

Laravel Scout OpenSearch is an open-sourced software licensed under the [MIT license](LICENSE).

0 comments on commit e8e8d3b

Please sign in to comment.