Skip to content
This repository was archived by the owner on Sep 11, 2018. It is now read-only.

Commit 3806fcd

Browse files
committed
Adds support for synonyms
1 parent 6aef185 commit 3806fcd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/AlgoliaEloquentTrait.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ public function _setSettings()
158158
}, $settings['slaves']);
159159
}
160160

161+
if (isset($settings['synonyms'])) {
162+
$index->batchSynonyms($settings['synonyms'], true, true);
163+
unset($settings['synonyms']);
164+
}
165+
161166
if (count(array_keys($settings)) > 0) {
162167
$index->setSettings($settings);
163168
}
@@ -265,4 +270,4 @@ public function removeFromIndex()
265270
$index->deleteObject($modelHelper->getObjectId($this));
266271
}
267272
}
268-
}
273+
}

0 commit comments

Comments
 (0)