@@ -160,11 +160,13 @@ public function custom_boost_factor()
160
160
*
161
161
* @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-constant-score-query.html
162
162
*
163
+ * @param null|\Elastica\Filter\AbstractFilter|array $filter
164
+ *
163
165
* @return ConstantScore
164
166
*/
165
- public function constant_score ()
167
+ public function constant_score ($ filter = null )
166
168
{
167
- return new ConstantScore ();
169
+ return new ConstantScore ($ filter );
168
170
}
169
171
170
172
/**
@@ -199,7 +201,7 @@ public function field()
199
201
*
200
202
* @return Filtered
201
203
*/
202
- public function filtered (AbstractQuery $ query , AbstractFilter $ filter )
204
+ public function filtered (AbstractQuery $ query = null , AbstractFilter $ filter = null )
203
205
{
204
206
return new Filtered ($ query , $ filter );
205
207
}
@@ -243,11 +245,14 @@ public function function_score()
243
245
*
244
246
* @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html
245
247
*
248
+ * @param string $fieldName Field name
249
+ * @param string $value String to search for
250
+ *
246
251
* @return Fuzzy
247
252
*/
248
- public function fuzzy ()
253
+ public function fuzzy ($ fieldName = null , $ value = null )
249
254
{
250
- return new Fuzzy ();
255
+ return new Fuzzy ($ fieldName , $ value );
251
256
}
252
257
253
258
/**
@@ -265,12 +270,12 @@ public function geo_shape()
265
270
*
266
271
* @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-has-child-query.html
267
272
*
268
- * @param AbstractQuery $query
269
- * @param null| string $ type
273
+ * @param string|\Elastica\Query|\Elastica\Query\ AbstractQuery $query
274
+ * @param string $type Parent document type
270
275
*
271
276
* @return HasChild
272
277
*/
273
- public function has_child (AbstractQuery $ query , $ type = null )
278
+ public function has_child ($ query , $ type = null )
274
279
{
275
280
return new HasChild ($ query , $ type );
276
281
}
@@ -280,12 +285,12 @@ public function has_child(AbstractQuery $query, $type = null)
280
285
*
281
286
* @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-has-parent-query.html
282
287
*
283
- * @param AbstractQuery $query
284
- * @param string $ type
288
+ * @param string|\Elastica\Query|\Elastica\Query\ AbstractQuery $query
289
+ * @param string $type Parent document type
285
290
*
286
291
* @return HasParent
287
292
*/
288
- public function has_parent (AbstractQuery $ query , $ type )
293
+ public function has_parent ($ query , $ type )
289
294
{
290
295
return new HasParent ($ query , $ type );
291
296
}
@@ -300,7 +305,7 @@ public function has_parent(AbstractQuery $query, $type)
300
305
*
301
306
* @return Ids
302
307
*/
303
- public function ids ($ type , array $ ids )
308
+ public function ids ($ type = null , array $ ids = array () )
304
309
{
305
310
return new Ids ($ type , $ ids );
306
311
}
@@ -367,23 +372,27 @@ public function nested()
367
372
*
368
373
* @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-prefix-query.html
369
374
*
375
+ * @param array $prefix Prefix array
376
+ *
370
377
* @return Prefix
371
378
*/
372
- public function prefix ()
379
+ public function prefix (array $ prefix = array () )
373
380
{
374
- return new Prefix ();
381
+ return new Prefix ($ prefix );
375
382
}
376
383
377
384
/**
378
385
* query string query.
379
386
*
380
387
* @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html
381
388
*
389
+ * @param string $queryString OPTIONAL Query string for object
390
+ *
382
391
* @return QueryString
383
392
*/
384
- public function query_string ()
393
+ public function query_string ($ queryString = '' )
385
394
{
386
- return new QueryString ();
395
+ return new QueryString ($ queryString );
387
396
}
388
397
389
398
/**
@@ -411,25 +420,25 @@ public function simple_query_string($query, array $fields = array())
411
420
*
412
421
* @return Range
413
422
*/
414
- public function range ($ fieldName , array $ args )
423
+ public function range ($ fieldName = null , array $ args = array () )
415
424
{
416
425
return new Range ($ fieldName , $ args );
417
426
}
418
427
419
428
/**
420
429
* regexp query.
421
430
*
422
- * @param string $fieldName
431
+ * @param string $key
423
432
* @param string $value
424
433
* @param float $boost
425
434
*
426
435
* @return Regexp
427
436
*
428
437
* @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html
429
438
*/
430
- public function regexp ($ fieldName , $ value , $ boost )
439
+ public function regexp ($ key = '' , $ value = null , $ boost = 1.0 )
431
440
{
432
- return new Regexp ($ fieldName , $ value , $ boost );
441
+ return new Regexp ($ key , $ value , $ boost );
433
442
}
434
443
435
444
/**
@@ -511,27 +520,27 @@ public function term(array $term = array())
511
520
*
512
521
* @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html
513
522
*
514
- * @param string $field
523
+ * @param string $key
515
524
* @param array $terms
516
525
*
517
526
* @return Terms
518
527
*/
519
- public function terms ($ field , array $ terms )
528
+ public function terms ($ key = '' , array $ terms = array () )
520
529
{
521
- return new Terms ($ field , $ terms );
530
+ return new Terms ($ key , $ terms );
522
531
}
523
532
524
533
/**
525
534
* top children query.
526
535
*
527
536
* @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-top-children-query.html
528
537
*
529
- * @param AbstractQuery $query
530
- * @param string $type
538
+ * @param string| AbstractQuery|\Elastica\Query $query
539
+ * @param string $type
531
540
*
532
541
* @return TopChildren
533
542
*/
534
- public function top_children (AbstractQuery $ query , $ type )
543
+ public function top_children ($ query , $ type = null )
535
544
{
536
545
return new TopChildren ($ query , $ type );
537
546
}
@@ -541,11 +550,15 @@ public function top_children(AbstractQuery $query, $type)
541
550
*
542
551
* @link http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-wildcard-query.html
543
552
*
553
+ * @param string $key OPTIONAL Wildcard key
554
+ * @param string $value OPTIONAL Wildcard value
555
+ * @param float $boost OPTIONAL Boost value (default = 1)
556
+ *
544
557
* @return Wildcard
545
558
*/
546
- public function wildcard ()
559
+ public function wildcard ($ key = '' , $ value = null , $ boost = 1.0 )
547
560
{
548
- return new Wildcard ();
561
+ return new Wildcard ($ key , $ value , $ boost );
549
562
}
550
563
551
564
/**
0 commit comments