We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 996e865 commit 6505cbdCopy full SHA for 6505cbd
src/Query/Exists.php
@@ -0,0 +1,41 @@
1
+<?php declare(strict_types = 1);
2
+
3
+namespace Spameri\ElasticQuery\Query;
4
5
6
+/**
7
+ * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html
8
+ */
9
+class Exists implements LeafQueryInterface
10
+{
11
12
+ /**
13
+ * @var string
14
15
+ private $field;
16
17
18
+ public function __construct(
19
+ string $field
20
+ )
21
+ {
22
+ $this->field = $field;
23
+ }
24
25
26
+ public function key() : string
27
28
+ return 'exits_' . $this->field;
29
30
31
32
+ public function toArray() : array
33
34
+ return [
35
+ 'exists' => [
36
+ 'field' => $this->field,
37
+ ],
38
+ ];
39
40
41
+}
0 commit comments