1 | <?php |
||
18 | class Search |
||
19 | { |
||
20 | /** |
||
21 | * @var Index $index |
||
22 | */ |
||
23 | protected $index; |
||
24 | |||
25 | /** |
||
26 | * @var Query $query |
||
27 | */ |
||
28 | protected $query; |
||
29 | |||
30 | /** |
||
31 | * @var string|boolean $path |
||
32 | */ |
||
33 | private $path; |
||
34 | |||
35 | /** |
||
36 | * @var int $limit |
||
37 | */ |
||
38 | private $limit = 25; |
||
39 | |||
40 | /** |
||
41 | * @var int $offset |
||
42 | */ |
||
43 | private $offset = 0; |
||
44 | |||
45 | /** |
||
46 | * @var Boolean |
||
47 | */ |
||
48 | private static $boolean; |
||
49 | |||
50 | /** |
||
51 | * Search constructor. |
||
52 | * |
||
53 | * @param Index $index |
||
54 | * @param Query $query |
||
55 | */ |
||
56 | 29 | public function __construct(Index $index, Query $query) |
|
62 | |||
63 | /** |
||
64 | * @param $name |
||
65 | * @param $arguments |
||
66 | * @return $this |
||
67 | * @throws \BadMethodCallException |
||
68 | */ |
||
69 | 2 | public function __call($name, $arguments) |
|
78 | |||
79 | /** |
||
80 | * @param integer $limit |
||
81 | * @return $this |
||
82 | */ |
||
83 | 1 | public function limit($limit) |
|
88 | |||
89 | /** |
||
90 | * @param integer $offset |
||
91 | * @return $this |
||
92 | */ |
||
93 | 1 | public function offset($offset) |
|
98 | |||
99 | /** |
||
100 | * @param bool|string $path |
||
101 | * @return $this |
||
102 | */ |
||
103 | 18 | public function path($path = false) |
|
108 | |||
109 | /** |
||
110 | * @param $string |
||
111 | * @return $this |
||
112 | */ |
||
113 | 1 | public function raw($string) |
|
118 | |||
119 | /** |
||
120 | * @param $string |
||
121 | * @param null|string $field |
||
122 | * @param null $offsets |
||
123 | * @return $this |
||
124 | * @return $this |
||
125 | */ |
||
126 | 1 | public function phrase($string, $field = null, $offsets = null) |
|
131 | |||
132 | /** |
||
133 | * @param $string |
||
134 | * @param null|string $field |
||
135 | * @return $this |
||
136 | */ |
||
137 | 1 | public function fuzzy($string, $field = null) |
|
142 | |||
143 | /** |
||
144 | * @param $string |
||
145 | * @param null|string $field |
||
146 | * @return Term |
||
147 | */ |
||
148 | 2 | protected function indexTerm($string, $field = null) |
|
152 | |||
153 | /** |
||
154 | * @param $string |
||
155 | * @param null|string $field |
||
156 | * @return $this |
||
157 | */ |
||
158 | 1 | public function wildcard($string, $field = null) |
|
163 | |||
164 | /** |
||
165 | * Where |
||
166 | * |
||
167 | * A helper method to access phrase or to pass multiple fields. Phrase doesn't "match" exactly and |
||
168 | * allows searching within the text field rather than matching the whole string. |
||
169 | * |
||
170 | * @param boolean|$string |
||
171 | * @param null|string $field |
||
172 | * @return $this|bool |
||
173 | */ |
||
174 | 1 | public function where($string, $field = null) |
|
182 | |||
183 | /** |
||
184 | * Match |
||
185 | * |
||
186 | * Provides an exact pattern match. |
||
187 | * |
||
188 | * @param $string |
||
189 | * @param string $field |
||
190 | * @return $this |
||
191 | */ |
||
192 | public function match($string, $field = null) |
||
197 | |||
198 | /** |
||
199 | * @param array $terms |
||
200 | * @return $this |
||
201 | */ |
||
202 | 1 | public function multiTerm(array $terms) |
|
213 | |||
214 | /** |
||
215 | * @param string $string |
||
216 | * @param array $array |
||
217 | * @return mixed |
||
218 | */ |
||
219 | 1 | private function mapWhereArray($string, array $array) |
|
228 | |||
229 | /** |
||
230 | * @param string $string |
||
231 | * @param string|null $field |
||
232 | * @return QueryTerm |
||
233 | */ |
||
234 | 1 | public function term($string, $field = null) |
|
238 | |||
239 | /** |
||
240 | * @return mixed |
||
241 | */ |
||
242 | 1 | public function hits() |
|
248 | |||
249 | /** |
||
250 | * Slice |
||
251 | * |
||
252 | * This may look nasty, but there really isn't another way of offsetting results Lucene, and nor would |
||
253 | * you want to really, that's not what it's designed for. It will be quick up to a thousand and after |
||
254 | * that you should be asking the user to "refine their search". |
||
255 | * |
||
256 | * @param mixed $hits |
||
257 | * @return array |
||
258 | */ |
||
259 | 1 | public function slice($hits) |
|
263 | |||
264 | /** |
||
265 | * @param array|QueryHit $array |
||
266 | * @return mixed |
||
267 | */ |
||
268 | 2 | private function mapIds($array) |
|
277 | |||
278 | /** |
||
279 | * @return boolean |
||
280 | */ |
||
281 | 1 | public static function getLastQuery() |
|
285 | } |
||
286 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..