PHPackages                             ruger/scout-aws-elastic - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. ruger/scout-aws-elastic

AbandonedLibrary[Search &amp; Filtering](/categories/search)

ruger/scout-aws-elastic
=======================

Laravel Scout Elasticsearch driver with AWS support

v2.2.0(5y ago)0654MITPHPPHP ^7.4|^8.0

Since Jun 4Pushed 5y agoCompare

[ Source](https://github.com/cwoodrgr/scout-aws-elastic)[ Packagist](https://packagist.org/packages/ruger/scout-aws-elastic)[ RSS](/packages/ruger-scout-aws-elastic/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (14)Used By (0)

Scout AWS Elasticsearch Driver
==============================

[](#scout-aws-elasticsearch-driver)

This package is a wrapper around [babenkoivan/scout-elasticsearch-driver](https://packagist.org/packages/babenkoivan/scout-elasticsearch-driver), adding AWS support.

Requirements
------------

[](#requirements)

The package has been tested with the following configuration:

- PHP version 7.3.\*
- Laravel Framework version 6.11
- Elasticsearch version 7.1

Upgrading
---------

[](#upgrading)

If you are upgrading from before version 1.2.4, version 2.0.0 requires the `scout_elastic_aws` config file to be re-published or add `aws_enabled` key.

```
'aws_enabled' => env('SCOUT_AWS_ELASTIC_ENABLED', true);
```

Installation
------------

[](#installation)

Use composer to install package

```
composer require ruger/scout-aws-elastic
```

Configuration
-------------

[](#configuration)

To configure the package you need to publish the following settings:

```
php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"
php artisan vendor:publish --provider="ScoutElastic\ScoutElasticServiceProvider"
php artisan vendor:publish --provider="Ruger\ScoutAwsElastic\ScoutAwsElasticServiceProvider"
```

After publishing the configuration files, you can configure the connection to your Elasticsearch cluster with the following `.env` variables (Replace values with your own values):

```
SCOUT_DRIVER=elastic

SCOUT_ELASTIC_HOST=localhost
SCOUT_ELASTIC_SCHEME=https
SCOUT_ELASTIC_PORT=443
SCOUT_ELASTIC_USER=
SCOUT_ELASTIC_PASS=
SCOUT_AWS_ELASTIC_ENABLED=true
SCOUT_AWS_ELASTIC_REGION=us-east-2
SCOUT_AWS_ELASTIC_ACCESS_KEY=
SCOUT_AWS_ELASTIC_ACCESS_SECRET=
```

Usage
-----

[](#usage)

Because this package is a wrapper for babenkoivan/scout-elasticsearch-driver, all usage documentation can be found [here](https://github.com/babenkoivan/scout-elasticsearch-driver/blob/master/README.md)

RuleBuilder
-----------

[](#rulebuilder)

The RuleBuilder class can be extended to provide dynamic bool query array generation.

This can be used in conjunction with the `rule()` function provided by the ScoutElastic package.

### Available Methods:

[](#available-methods)

- `public function build(array $rules)` - Creates the rule array based on the associative array passed.
- `protected function must(string $field, $value, array $attributes)` - Creates a must match query clause.
- `protected funciton mustNot(string $field, $value, array $attributes)` - Creates a must\_not match query clause.
- `protected function should(string $field, $value, array $attributes)` - Creates a should match query clause.
- `protected function filter(string $field, $value, array $attributes)` - Creates a filter term query clause.
- `protected funciton range(string $field, array $values, string type)` - Creates a range query clause.

### Example

[](#example)

#### IndexConfigurator:

[](#indexconfigurator)

```
