1 | <?php |
||
12 | class Search extends LuceneSearch |
||
13 | { |
||
14 | use EloquentTrait; |
||
15 | |||
16 | private $hits = []; |
||
17 | |||
18 | /** |
||
19 | * Search constructor. |
||
20 | * @param Index $index |
||
21 | * @param Query $query |
||
22 | */ |
||
23 | 4 | public function __construct(Index $index, Query $query) |
|
28 | |||
29 | /** |
||
30 | * @return mixed |
||
31 | */ |
||
32 | public function get() |
||
39 | |||
40 | /** |
||
41 | * @param $id |
||
42 | * @return $this |
||
43 | */ |
||
44 | public function findId($id) |
||
49 | |||
50 | /** |
||
51 | * Hits |
||
52 | * |
||
53 | * We store the hits, no point in running the query twice. This also allows us to set the UID once for the model |
||
54 | * table name. A new search instance is required to run against another model. |
||
55 | * |
||
56 | * @return mixed |
||
57 | */ |
||
58 | public function hits() |
||
69 | |||
70 | /** |
||
71 | * @param $string |
||
72 | * @return $this |
||
73 | */ |
||
74 | public function find($string) |
||
79 | } |
||
80 |