File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 88class Synonym implements \Spameri \ElasticQuery \Mapping \FilterInterface
99{
1010
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+
1125 public function getType (): string
1226 {
1327 return 'synonym ' ;
1428 }
1529
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+
1659}
You can’t perform that action at this time.
0 commit comments