1 | <?php |
||
11 | class Select extends SolrRequest |
||
12 | { |
||
13 | const OPERATOR_AND = 'AND'; |
||
14 | const OPERATOR_OR = 'OR'; |
||
15 | |||
16 | const DEFTYPE_EDISMAX = 'edismax'; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $handlerName = 'select'; |
||
22 | |||
23 | /** |
||
24 | * $var string |
||
25 | */ |
||
26 | protected $responseClass = '\PSolr\Response\SearchResults'; |
||
27 | |||
28 | /** |
||
29 | * Helper function that turns associative arrays into boosted fields. |
||
30 | * |
||
31 | * - array('field' => 10.0) = "field^10.0". |
||
32 | * - array('field' => array(2, 10.0) = "field~2^10.0" |
||
33 | * |
||
34 | * @param string|array $fields |
||
35 | * |
||
36 | * @see https://wiki.apache.org/solr/DisMaxQParserPlugin#qf_.28Query_Fields.29 |
||
37 | * |
||
38 | * @todo Rethink this. |
||
39 | */ |
||
40 | public function buildBoostedFields($fields) |
||
61 | |||
62 | /** |
||
63 | * @param string $query |
||
64 | * |
||
65 | * @return \PSolr\Request\Select |
||
66 | * |
||
67 | * @see http://wiki.apache.org/solr/CommonQueryParameters#q |
||
68 | */ |
||
69 | public function setQuery($query) |
||
73 | |||
74 | /** |
||
75 | * @param string $sort |
||
76 | * |
||
77 | * @return \PSolr\Request\Select |
||
78 | * |
||
79 | * @todo Component\Sort.php |
||
80 | * |
||
81 | * @see http://wiki.apache.org/solr/CommonQueryParameters#sort |
||
82 | */ |
||
83 | public function setSort($sort) |
||
87 | |||
88 | /** |
||
89 | * @param int $rows |
||
|
|||
90 | * |
||
91 | * @return \PSolr\Request\Select |
||
92 | * |
||
93 | * @see http://wiki.apache.org/solr/CommonQueryParameters#start |
||
94 | */ |
||
95 | public function setStart($start) |
||
99 | |||
100 | /** |
||
101 | * @param int $rows |
||
102 | * |
||
103 | * @return \PSolr\Request\Select |
||
104 | * |
||
105 | * @see http://wiki.apache.org/solr/CommonQueryParameters#rows |
||
106 | */ |
||
107 | public function setRows($rows) |
||
111 | |||
112 | /** |
||
113 | * @param int $pageDoc |
||
114 | * |
||
115 | * @return \PSolr\Request\Select |
||
116 | * |
||
117 | * @see http://wiki.apache.org/solr/CommonQueryParameters#pageDoc_and_pageScore |
||
118 | */ |
||
119 | public function setPageDoc($pageDoc) |
||
123 | |||
124 | /** |
||
125 | * @param float $pageScore |
||
126 | * |
||
127 | * @return \PSolr\Request\Select |
||
128 | * |
||
129 | * @see http://wiki.apache.org/solr/CommonQueryParameters#pageDoc_and_pageScore |
||
130 | */ |
||
131 | public function setPageScore($pageScore) |
||
135 | |||
136 | /** |
||
137 | * @param string $fq |
||
138 | * |
||
139 | * @return \PSolr\Request\Select |
||
140 | * |
||
141 | * @see http://wiki.apache.org/solr/CommonQueryParameters#fq |
||
142 | */ |
||
143 | public function addFilterQuery($filterQuery) |
||
147 | |||
148 | /** |
||
149 | * @param string|array $fieldList |
||
150 | * |
||
151 | * @return \PSolr\Request\Select |
||
152 | * |
||
153 | * @see http://wiki.apache.org/solr/CommonQueryParameters#fl |
||
154 | */ |
||
155 | public function setFieldList($fieldList) |
||
159 | |||
160 | /** |
||
161 | * @param string $defType |
||
162 | * |
||
163 | * @return \PSolr\Request\Select |
||
164 | * |
||
165 | * @see http://wiki.apache.org/solr/CommonQueryParameters#defType |
||
166 | */ |
||
167 | public function setDefType($defType) |
||
171 | |||
172 | /** |
||
173 | * @param int $timeAllowed |
||
174 | * |
||
175 | * @return \PSolr\Request\Select |
||
176 | * |
||
177 | * @see http://wiki.apache.org/solr/CommonQueryParameters#timeAllowed |
||
178 | */ |
||
179 | public function setTimeAllowed($timeAllowed) |
||
183 | |||
184 | /** |
||
185 | * @param boolean $omitHeader |
||
186 | * |
||
187 | * @return \PSolr\Request\Select |
||
188 | * |
||
189 | * @see http://wiki.apache.org/solr/CommonQueryParameters#omitHeader |
||
190 | */ |
||
191 | public function omitHeader($omitHeader) |
||
195 | |||
196 | /** |
||
197 | * @param string $operator |
||
198 | * |
||
199 | * @return \PSolr\Request\Select |
||
200 | * |
||
201 | * @see http://wiki.apache.org/solr/SearchHandler#q.op |
||
202 | */ |
||
203 | public function setDefaultOperator($operator) |
||
207 | |||
208 | /** |
||
209 | * @param string $field |
||
210 | * |
||
211 | * @return \PSolr\Request\Select |
||
212 | * |
||
213 | * @see http://wiki.apache.org/solr/SearchHandler#df |
||
214 | */ |
||
215 | public function setDefaultField($field) |
||
219 | |||
220 | /** |
||
221 | * @param string $query |
||
222 | * |
||
223 | * @return \PSolr\Request\Select |
||
224 | * |
||
225 | * @see http://wiki.apache.org/solr/ExtendedDisMax#q.alt |
||
226 | */ |
||
227 | public function setAlternateQuery($query) |
||
231 | |||
232 | /** |
||
233 | * @param string|array $fields |
||
234 | * An associative array of fields to boosts, e.g. array('field' => 2.0); |
||
235 | * |
||
236 | * @return \PSolr\Request\Select |
||
237 | * |
||
238 | * @see http://wiki.apache.org/solr/ExtendedDisMax#qf_.28Query_Fields.29 |
||
239 | */ |
||
240 | public function setQueryFields($fields) |
||
244 | |||
245 | /** |
||
246 | * @param string $mm |
||
247 | * |
||
248 | * @return \PSolr\Request\Select |
||
249 | * |
||
250 | * @see http://wiki.apache.org/solr/ExtendedDisMax#mm_.28Minimum_.27Should.27_Match.29 |
||
251 | */ |
||
252 | public function setMinimumShouldMatch($mm) |
||
256 | |||
257 | /** |
||
258 | * @param string $slop |
||
259 | * |
||
260 | * @return \PSolr\Request\Select |
||
261 | * |
||
262 | * @see http://wiki.apache.org/solr/ExtendedDisMax#qs_.28Query_Phrase_Slop.29 |
||
263 | */ |
||
264 | public function setQueryPhraseSlop($slop) |
||
268 | |||
269 | /** |
||
270 | * @param string|array $fields |
||
271 | * An associative array of fields to boosts, e.g. array('field' => 2.0). |
||
272 | * Pass an array of values to add slop, e.g. array('field', array(2, 10.0) |
||
273 | * will render "field~2^10". |
||
274 | * |
||
275 | * @return \PSolr\Request\Select |
||
276 | * |
||
277 | * @see http://wiki.apache.org/solr/ExtendedDisMax#pf_.28Phrase_Fields.29 |
||
278 | */ |
||
279 | public function setPhraseFields($fields) |
||
283 | |||
284 | /** |
||
285 | * @param float $slop |
||
286 | * |
||
287 | * @return \PSolr\Request\Select |
||
288 | * |
||
289 | * @see http://wiki.apache.org/solr/ExtendedDisMax#ps_.28Phrase_Slop.29 |
||
290 | */ |
||
291 | public function setPhraseSlop($slop) |
||
295 | |||
296 | /** |
||
297 | * @param string|array $fields |
||
298 | * An associative array of fields to boosts, e.g. array('field' => 2.0). |
||
299 | * Pass an array of values to add slop, e.g. array('field', array(2, 10.0) |
||
300 | * will render "field~2^10". |
||
301 | * |
||
302 | * @return \PSolr\Request\Select |
||
303 | * |
||
304 | * @see http://wiki.apache.org/solr/ExtendedDisMax#pf2_.28Phrase_bigram_fields.29 |
||
305 | */ |
||
306 | public function setPhraseBigramFields($fields) |
||
310 | |||
311 | /** |
||
312 | * @param float $slop |
||
313 | * |
||
314 | * @return \PSolr\Request\Select |
||
315 | * |
||
316 | * @see http://wiki.apache.org/solr/ExtendedDisMax#ps2_.28Phrase_bigram_slop.29 |
||
317 | */ |
||
318 | public function setPhraseBigramSlop($slop) |
||
322 | |||
323 | /** |
||
324 | * @param string|array $fields |
||
325 | * An associative array of fields to boosts, e.g. array('field' => 2.0). |
||
326 | * Pass an array of values to add slop, e.g. array('field', array(2, 10.0) |
||
327 | * will render "field~2^10". |
||
328 | * |
||
329 | * @return \PSolr\Request\Select |
||
330 | * |
||
331 | * @see http://wiki.apache.org/solr/ExtendedDisMax#pf3_.28Phrase_trigram_fields.29 |
||
332 | */ |
||
333 | public function setPhraseTrigramFields($fields) |
||
337 | |||
338 | /** |
||
339 | * @param float $slop |
||
340 | * |
||
341 | * @return \PSolr\Request\Select |
||
342 | * |
||
343 | * @see http://wiki.apache.org/solr/ExtendedDisMax#ps3_.28Phrase_trigram_slop.29 |
||
344 | */ |
||
345 | public function setPhraseTrigramSlop($slop) |
||
349 | |||
350 | /** |
||
351 | * @param float $tieBreaker |
||
352 | * |
||
353 | * @return \PSolr\Request\Select |
||
354 | * |
||
355 | * @see http://wiki.apache.org/solr/ExtendedDisMax#tie_.28Tie_breaker.29 |
||
356 | */ |
||
357 | public function setTieBreaker($tieBreaker) |
||
361 | |||
362 | /** |
||
363 | * @param string $query |
||
364 | * |
||
365 | * @return \PSolr\Request\Select |
||
366 | * |
||
367 | * @see http://wiki.apache.org/solr/ExtendedDisMax#bq_.28Boost_Query.29 |
||
368 | */ |
||
369 | public function setBoostQuery($query) |
||
373 | |||
374 | /** |
||
375 | * @param string $function |
||
376 | * @param bool $multiplicative |
||
377 | * Defaults to false (additive), pass true for multiplicitive. |
||
378 | * |
||
379 | * @return \PSolr\Request\Select |
||
380 | * |
||
381 | * @see http://wiki.apache.org/solr/ExtendedDisMax#bf_.28Boost_Function.2C_additive.29 |
||
382 | * @see http://wiki.apache.org/solr/ExtendedDisMax#boost_.28Boost_Function.2C_multiplicative.29 |
||
383 | * @see http://wiki.apache.org/solr/FunctionQuery |
||
384 | */ |
||
385 | public function addBoostFunction($function, $multiplicative = false) |
||
390 | |||
391 | /** |
||
392 | * @param string|array $fields |
||
393 | * |
||
394 | * @return \PSolr\Request\Select |
||
395 | * |
||
396 | * @see http://wiki.apache.org/solr/ExtendedDisMax#uf_.28User_Fields.29 |
||
397 | */ |
||
398 | public function setUserFields($fields) |
||
402 | |||
403 | /** |
||
404 | * @param bool $interpret |
||
405 | * |
||
406 | * @return \Psolr\Component\Facet |
||
407 | * |
||
408 | * @see http://wiki.apache.org/solr/ExtendedDisMax#lowercaseOperators |
||
409 | */ |
||
410 | public function interpretLowercaseOperators($interpret = true) |
||
414 | } |
||
415 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.