Total Complexity | 3 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
11 | class ElasticsearchDsl implements ElasticsearchDslContract |
||
12 | { |
||
13 | /** |
||
14 | * Get es client |
||
15 | * |
||
16 | * @return Client |
||
17 | */ |
||
18 | 1 | public function getEsClient(): Client |
|
21 | } |
||
22 | |||
23 | /** |
||
24 | * Search |
||
25 | * |
||
26 | * @param OngrSearch|null $search |
||
27 | * @param string|null $esIndex |
||
28 | * @param string|null $esType |
||
29 | * @return Search |
||
30 | */ |
||
31 | 14 | public function search( |
|
32 | ?OngrSearch $search = null, |
||
33 | ?string $esIndex = null, |
||
34 | ?string $esType = null |
||
35 | ): Search { |
||
36 | 14 | return app()->makeWith(Search::class, [ |
|
37 | 14 | 'search' => $search, |
|
38 | 14 | 'esIndex' => $esIndex, |
|
39 | 14 | 'esType' => $esType |
|
40 | ]); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Suggestion |
||
45 | * |
||
46 | * @param OngrSearch|null $search |
||
47 | * @return Suggestion |
||
48 | */ |
||
49 | 3 | public function suggest(?OngrSearch $search = null): Suggestion |
|
53 | ]); |
||
54 | } |
||
56 |