chrysanthos / scout-elastic-app-search-driver
Laravel Scout Adapter for Elastic Enterprise App Search
Requires
- php: ^7.4|^8.0|^8.1
- elastic/enterprise-search: ^7.1
- laravel/scout: ^9.0
Requires (Dev)
- orchestra/testbench: ^6.17
- phpunit/phpunit: ^9.3
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
- Keoghan Litchfield (Initial work)
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.