File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ # Elastic App Search Driver for Laravel Scout
2+
3+ This package is a work in progress. Avoid using this on production environments.
4+
5+ Integrate [ Elastic App Search] ( https://www.elastic.co/enterprise-search ) with [ Laravel Scout] ( https://laravel.com/docs/8.x/scout ) .
6+
7+ This is an early but functional version. Tests to be added.
8+
9+ ## Installation
10+
11+ You can install the package via composer:
12+
13+ ``` bash
14+ composer require chrysanthos/scout-elastic-app-search-driver
15+ ```
16+
17+ ## Usage
18+
19+ In order to use the package, you must set Laravel Scout to use the driver
20+ ``` dotenv
21+ SCOUT_DRIVER=elastic-app-search
22+ ```
23+
24+ Then set up the connection details for Elastic App Search
25+
26+ ``` dotenv
27+ SCOUT_ELASTIC_APP_SEARCH_ENDPOINT=
28+ SCOUT_ELASTIC_APP_SEARCH_API_KEY=
29+ ```
30+
31+ You will also need to adjust ` config/scout.php ` so that the chunk sizes are 100 records:
32+
33+ ``` php
34+ 'chunk' => [
35+ 'searchable' => 100,
36+ 'unsearchable' => 100,
37+ ],
38+ ```
39+
40+ Once you have added the Searchable Trait to your model. You will be able to search with:
41+ ``` php
42+ $result = Model::search($searchTerm)->get();
43+ ```
You can’t perform that action at this time.
0 commit comments