We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 112375c commit 89d9e5cCopy full SHA for 89d9e5c
1 file changed
src/Mapping/Filter/Synonym.php
@@ -8,9 +8,52 @@
8
class Synonym implements \Spameri\ElasticQuery\Mapping\FilterInterface
9
{
10
11
+ /**
12
+ * @var array<string>
13
+ */
14
+ private $synonyms;
15
+
16
17
+ public function __construct(
18
+ array $synonyms = []
19
+ )
20
+ {
21
+ $this->synonyms = $synonyms;
22
+ }
23
24
25
public function getType(): string
26
27
return 'synonym';
28
}
29
30
31
+ public function getSynonyms() : array
32
33
+ return $this->synonyms;
34
35
36
37
+ public function getName() : string
38
39
+ return 'customSynonyms';
40
41
42
43
+ public function key() : string
44
45
+ return $this->getName();
46
47
48
49
+ public function toArray() : array
50
51
+ return [
52
+ $this->getName() => [
53
+ 'type' => $this->getType(),
54
+ 'synonyms' => $this->synonyms,
55
+ ],
56
+ ];
57
58
59
0 commit comments