88class FilterBuilder extends Builder
99{
1010 /**
11+ * The condition array.
12+ *
1113 * @var array
1214 */
1315 public $ wheres = [
1416 'must ' => [],
15- 'must_not ' => []
17+ 'must_not ' => [],
1618 ];
1719
1820 /**
21+ * The with array.
22+ *
1923 * @var array|string
2024 */
2125 public $ with ;
2226
2327 /**
28+ * The offset
29+ *
2430 * @var int
2531 */
2632 public $ offset ;
2733
2834 /**
35+ * The collapse parameter.
36+ *
2937 * @var string
3038 */
3139 public $ collapse ;
3240
3341 /**
42+ * The select array.
43+ *
3444 * @var array
3545 */
3646 public $ select = [];
3747
3848 /**
39- * @param Model $model
49+ * FilterBuilder constructor.
50+ *
51+ * @param \Illuminate\Database\Eloquent\Model $model
4052 * @param callable|null $callback
4153 * @param bool $softDelete
54+ * @return void
4255 */
4356 public function __construct (Model $ model , $ callback = null , $ softDelete = false )
4457 {
@@ -55,6 +68,8 @@ public function __construct(Model $model, $callback = null, $softDelete = false)
5568 }
5669
5770 /**
71+ * Add a where condition.
72+ *
5873 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html Term query
5974 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html Range query
6075 *
@@ -136,6 +151,8 @@ public function where($field, $value)
136151 }
137152
138153 /**
154+ * Add a whereIn condition.
155+ *
139156 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html Terms query
140157 *
141158 * @param string $field
@@ -154,6 +171,8 @@ public function whereIn($field, array $value)
154171 }
155172
156173 /**
174+ * Add a whereNotIn condition.
175+ *
157176 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html Terms query
158177 *
159178 * @param string $field
@@ -172,6 +191,8 @@ public function whereNotIn($field, array $value)
172191 }
173192
174193 /**
194+ * Add a whereBetween condition.
195+ *
175196 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html Range query
176197 *
177198 * @param string $field
@@ -193,6 +214,8 @@ public function whereBetween($field, array $value)
193214 }
194215
195216 /**
217+ * Add a whereNotBetween condition.
218+ *
196219 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html Range query
197220 *
198221 * @param string $field
@@ -214,6 +237,8 @@ public function whereNotBetween($field, array $value)
214237 }
215238
216239 /**
240+ * Add a whereExists condition.
241+ *
217242 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html Exists query
218243 *
219244 * @param string $field
@@ -231,6 +256,8 @@ public function whereExists($field)
231256 }
232257
233258 /**
259+ * Add a whereNotExists condition
260+ *
234261 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html Exists query
235262 *
236263 * @param string $field
@@ -248,6 +275,8 @@ public function whereNotExists($field)
248275 }
249276
250277 /**
278+ * Add a whereRegexp condition.
279+ *
251280 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html Regexp query
252281 *
253282 * @param string $field
@@ -270,6 +299,8 @@ public function whereRegexp($field, $value, $flags = 'ALL')
270299 }
271300
272301 /**
302+ * Add a whereGeoDistance condition.
303+ *
273304 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-query.html Geo distance query
274305 *
275306 * @param string $field
@@ -290,6 +321,8 @@ public function whereGeoDistance($field, $value, $distance)
290321 }
291322
292323 /**
324+ * Add a whereGeoBoundingBox condition.
325+ *
293326 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-bounding-box-query.html Geo bounding box query
294327 *
295328 * @param string $field
@@ -308,6 +341,8 @@ public function whereGeoBoundingBox($field, array $value)
308341 }
309342
310343 /**
344+ * Add a whereGeoPolygon condition.
345+ *
311346 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-polygon-query.html Geo polygon query
312347 *
313348 * @param string $field
@@ -326,8 +361,10 @@ public function whereGeoPolygon($field, array $points)
326361
327362 return $ this ;
328363 }
329-
364+
330365 /**
366+ * Add a whereGeoShape condition.
367+ *
331368 * @see https://www.elastic.co/guide/en/elasticsearch/guide/current/querying-geo-shapes.html Querying Geo Shapes
332369 *
333370 * @param string $field
@@ -346,8 +383,10 @@ public function whereGeoShape($field, array $shape)
346383
347384 return $ this ;
348385 }
349-
386+
350387 /**
388+ * Add a orderBy clause.
389+ *
351390 * @param string $field
352391 * @param string $direction
353392 * @return $this
@@ -362,6 +401,8 @@ public function orderBy($field, $direction = 'asc')
362401 }
363402
364403 /**
404+ * Explain the request.
405+ *
365406 * @return array
366407 */
367408 public function explain ()
@@ -372,6 +413,8 @@ public function explain()
372413 }
373414
374415 /**
416+ * Profile the request.
417+ *
375418 * @return array
376419 */
377420 public function profile ()
@@ -382,6 +425,8 @@ public function profile()
382425 }
383426
384427 /**
428+ * Build the payload.
429+ *
385430 * @return array
386431 */
387432 public function buildPayload ()
@@ -392,6 +437,8 @@ public function buildPayload()
392437 }
393438
394439 /**
440+ * Eager load some some relations.
441+ *
395442 * @param array|string $relations
396443 * @return $this
397444 */
@@ -403,6 +450,8 @@ public function with($relations)
403450 }
404451
405452 /**
453+ * Set the query offset.
454+ *
406455 * @param int $offset
407456 * @return $this
408457 */
@@ -444,6 +493,8 @@ public function paginate($perPage = null, $pageName = 'page', $page = null)
444493 }
445494
446495 /**
496+ * Collapse by a field.
497+ *
447498 * @param string $field
448499 * @return $this
449500 */
@@ -455,6 +506,8 @@ public function collapse(string $field)
455506 }
456507
457508 /**
509+ * Select one or many fields.
510+ *
458511 * @param mixed $fields
459512 * @return $this
460513 */
@@ -469,6 +522,8 @@ public function select($fields)
469522 }
470523
471524 /**
525+ * Get the count.
526+ *
472527 * @return int
473528 */
474529 public function count ()
0 commit comments