1 | <?php |
||
22 | * |
||
23 | * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-all-query.html |
||
24 | */ |
||
25 | class MatchAllQuery implements BuilderInterface |
||
26 | { |
||
27 | use ParametersTrait; |
||
28 | |||
29 | public function __construct(array $parameters = []) |
||
30 | { |
||
31 | $this->setParameters($parameters); |
||
32 | } |
||
33 | |||
34 | public function getType(): string |
||
35 | { |
||
36 | return 'match_all'; |
||
37 | } |
||
38 | |||
39 | public function toArray(): array | stdClass |
||
|
|||
40 | { |
||
41 | $params = $this->getParameters(); |
||
42 | |||
43 | return [$this->getType() => $params ?: new stdClass()]; |
||
44 | } |
||
45 | } |
||
46 |