Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chrysanthos/scout-elastic-app-search-driver

Elastic App Search Driver for Laravel Scout
https://github.com/chrysanthos/scout-elastic-app-search-driver

app-search elastic-app-search elasticsearch hacktoberfest laravel laravel-scout laravel-scout-driver

Last synced: 15 days ago
JSON representation

Elastic App Search Driver for Laravel Scout

Awesome Lists containing this project

README

        

# Elastic App Search Driver for Laravel Scout

This package is a work in progress. Avoid using this on production environments.

Integrate [Elastic App Search](https://www.elastic.co/enterprise-search) with [Laravel Scout](https://laravel.com/docs/8.x/scout).

This is an early but functional version. Tests to be added.

## Installation

You can install the package via composer:

```bash
composer require chrysanthos/scout-elastic-app-search-driver
```

## Usage

In order to use the package, you must set Laravel Scout to use the driver
```dotenv
SCOUT_DRIVER=elastic-app-search
```

Then set up the connection details for Elastic App Search

```dotenv
SCOUT_ELASTIC_APP_SEARCH_ENDPOINT=
SCOUT_ELASTIC_APP_SEARCH_API_KEY=
```

You must also adjust your `config/scout.php` file so that the chunk sizes are up to 100 records. (This is needed because App Search only allows importing up to 100 records at a time.)

```php
'chunk' => [
'searchable' => 100,
'unsearchable' => 100,
],
```

Once you have added the Searchable Trait to your model. You will be able to search with:
```php
$result = Model::search($searchTerm)->get();
```

## Testing

```bash
composer test
```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

## Credits
- [Keoghan Litchfield](https://github.com/konsulting) (Initial work)

## Licence
This package is [Treeware](https://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/chrysanthos/scout-elastic-app-search-driver) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.