Skip to content

Commit c771c63

Browse files
authored
Merge pull request #88 from Flowpack/allow-index-prefix-from-settings
FEATURE: Allow configuring a prefix for the index name via Settings
2 parents 3c5a287 + b8a4f9c commit c771c63

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Classes/Domain/Model/Index.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ public function __construct(string $name, Client $client = null)
122122
public function injectSettings(array $settings): void
123123
{
124124
$this->settings = $settings;
125+
$indexSettings = $this->getSettings();
126+
if (!isset($indexSettings['prefix']) || empty($indexSettings['prefix'])) {
127+
return;
128+
}
129+
// This is obviously a side effect but can only be done after injecting settings
130+
// and it needs to be done as early as possible
131+
$this->name = $settings['prefix'] . '-' . $this->name;
125132
}
126133

127134
/**

0 commit comments

Comments
 (0)