1 | <?php |
||
21 | * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html |
||
22 | */ |
||
23 | class ExistsQuery implements BuilderInterface |
||
24 | { |
||
25 | public function __construct(private string $field) |
||
|
|||
26 | { |
||
27 | } |
||
28 | |||
29 | public function getType(): string |
||
30 | { |
||
31 | return 'exists'; |
||
32 | } |
||
33 | |||
34 | public function toArray(): array |
||
35 | { |
||
36 | return [ |
||
37 | $this->getType() => [ |
||
38 | 'field' => $this->field, |
||
39 | ], |
||
40 | ]; |
||
41 | } |
||
42 | } |
||
43 |