chrysanthos/scout-elastic-app-search-driver

Laravel Scout Adapter for Elastic Enterprise App Search

0.0.1 2022-02-05 12:48 UTC

This package is auto-updated.

Last update: 2024-04-12 16:51:17 UTC


README

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

Integrate Elastic App Search with Laravel Scout.

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

Installation

You can install the package via composer:

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

Usage

In order to use the package, you must set Laravel Scout to use the driver

SCOUT_DRIVER=elastic-app-search

Then set up the connection details for Elastic App Search

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.)

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

Once you have added the Searchable Trait to your model. You will be able to search with:

 $result = Model::search($searchTerm)->get();

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email me@chrysanthos.xyz instead of using the issue tracker.

Credits

Licence

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.