PHPackages                             logcomex/aws-elasticsearch-laravel - 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. logcomex/aws-elasticsearch-laravel

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

logcomex/aws-elasticsearch-laravel
==================================

AWS Elasticsearch Service for Laravel/Lumen

v1.5.1(7y ago)12MITPHPPHP &gt;=7.0

Since Dec 4Pushed 5y agoCompare

[ Source](https://github.com/comexio/aws-elasticsearch-laravel)[ Packagist](https://packagist.org/packages/logcomex/aws-elasticsearch-laravel)[ Docs](https://github.com/elegisandi/aws-elasticsearch-laravel)[ RSS](/packages/logcomex-aws-elasticsearch-laravel/feed)WikiDiscussions master Synced 1mo ago

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

aws-elasticsearch-laravel
=========================

[](#aws-elasticsearch-laravel)

AWS Elasticsearch Service for Laravel/Lumen

**NOTE:** This package only caters search, aggregation, and indexing transactions. Other than that, you can refer to [elasticsearch's official documentation](https://www.elastic.co/guide/en/elasticsearch/client/php-api/index.html).

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

[](#installation)

```
composer require elegisandi/aws-elasticsearch-laravel

```

Laravel/Lumen Integration
-------------------------

[](#laravellumen-integration)

- Add service provider to your `config/app.php` providers

    ```
    elegisandi\AWSElasticsearchService\ElasticSearchServiceProvider::class

    ```
- Add facade to your `config/app.php` aliases

    ```
    'ElasticSearch' => elegisandi\AWSElasticsearchService\Facades\ElasticSearch::class

    ```
- Set AWS credentials and Elasticsearch config in your `.env` file

    ```
      AWS_ACCESS_KEY_ID
      AWS_SECRET_ACCESS_KEY
      AWS_REGION

      ELASTICSEARCH_ENDPOINT
      ELASTICSEARCH_PORT
      ELASTICSEARCH_SHARDS
      ELASTICSEARCH_REPLICAS
      ELASTICSEARCH_DEFAULT_INDEX
      ELASTICSEARCH_DEFAULT_TYPE
      ELASTICSEARCH_DEFAULT_TIME_FILTER_FIELD

    ```

    When you are already using aws elasticsearch service, set

    ```
      AWS_ELASTICSEARCH_SERVICE=true

    ```

**If you want to configure elasticsearch mappings, settings and/or default type and index, just run:**

```
php artisan vendor:publish --provider=elegisandi\\AWSElasticsearchService\\ElasticSearchServiceProvider

```

**For Lumen:**

- Register service provider to your `bootstrap/app.php`

    ```
    $app->register(elegisandi\AWSElasticsearchService\ElasticSearchServiceProvider::class);

    ```

Basic Usage
-----------

[](#basic-usage)

**Using Facade:**

```
