We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ee0967 commit eb8fa30Copy full SHA for eb8fa30
1 file changed
src/Query/MatchAll.php
@@ -0,0 +1,44 @@
1
+<?php declare(strict_types = 1);
2
+
3
+namespace Spameri\ElasticQuery\Query;
4
5
+/**
6
+ * Match all documents query.
7
+ *
8
+ * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-all-query.html
9
+ */
10
+class MatchAll implements \Spameri\ElasticQuery\Query\LeafQueryInterface
11
+{
12
13
+ public function __construct(
14
+ private float $boost = 1.0,
15
+ )
16
+ {
17
+ }
18
19
20
+ public function key(): string
21
22
+ return 'match_all';
23
24
25
26
+ /**
27
+ * @return array<string, mixed>
28
29
+ public function toArray(): array
30
31
+ if ($this->boost !== 1.0) {
32
+ return [
33
+ 'match_all' => [
34
+ 'boost' => $this->boost,
35
+ ],
36
+ ];
37
38
39
40
+ 'match_all' => new \stdClass(),
41
42
43
44
+}
0 commit comments