1 | <?php |
||
7 | class ElasticSearcher extends Facade |
||
8 | { |
||
9 | /** |
||
10 | * Search the Elastic Search Index using the given parameters |
||
11 | * |
||
12 | * @param $params |
||
13 | * |
||
14 | * @return array |
||
15 | */ |
||
16 | public static function search($params, $object = null) |
||
27 | |||
28 | /** |
||
29 | * Runs an advanced search against Elastic Search |
||
30 | * @param $params |
||
31 | * |
||
32 | * @return array |
||
33 | */ |
||
34 | public static function advanced($params, $object = null) |
||
48 | |||
49 | /** |
||
50 | * Calls the Search function on the ElasticSearch Client |
||
51 | * @param $params |
||
52 | * |
||
53 | * @return array |
||
54 | */ |
||
55 | protected static function performSearch($params) |
||
59 | |||
60 | /** |
||
61 | * Checks whether the passed is an instance |
||
62 | * of Eloquent model or class name |
||
63 | * |
||
64 | * @param $object |
||
65 | * |
||
66 | * @return array |
||
67 | */ |
||
68 | protected static function addType($object) |
||
78 | |||
79 | /** |
||
80 | * Check whether the query is a simple text or an array |
||
81 | * |
||
82 | * @param $params |
||
83 | * |
||
84 | * @return array |
||
85 | */ |
||
86 | protected static function buildQuery($params) |
||
95 | |||
96 | /** |
||
97 | * Handles search if parameter is an array |
||
98 | * @param $params |
||
99 | * |
||
100 | * @return array |
||
101 | */ |
||
102 | protected static function handleArray($params) |
||
112 | |||
113 | /** |
||
114 | * Handles search if parameter is a simple array |
||
115 | * @param $params |
||
116 | * |
||
117 | * @return array |
||
118 | */ |
||
119 | protected static function handleTerm($params) |
||
131 | |||
132 | /** |
||
133 | * @param $object |
||
134 | * |
||
135 | * @return mixed |
||
136 | * @throws \Exception |
||
137 | */ |
||
138 | protected static function checkValidEloquent($object) |
||
146 | } |