We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c1451f commit 87c2b5aCopy full SHA for 87c2b5a
1 file changed
src/Mapping/Filter/CommonGrams.php
@@ -8,9 +8,37 @@
8
class CommonGrams implements \Spameri\ElasticQuery\Mapping\FilterInterface
9
{
10
11
+ /**
12
+ * @var array<string>
13
+ */
14
+ private $words;
15
+
16
17
+ public function __construct(array $words)
18
+ {
19
+ $this->words = $words;
20
+ }
21
22
23
public function getType(): string
24
25
return 'common_grams';
26
}
27
28
29
+ public function key(): string
30
31
+ return 'customCommonGrams';
32
33
34
35
+ public function toArray(): array
36
37
+ return [
38
+ $this->key() => [
39
+ 'type' => $this->getType(),
40
+ 'common_words' => $this->words,
41
+ ],
42
+ ];
43
44
0 commit comments