Skip to content

Commit c267186

Browse files
authored
Create README.md
1 parent 381374b commit c267186

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
```

0 commit comments

Comments
 (0)