/** * Returns index settings. * * @param string[] $synonyms Raw synonyms list. * @param string[] $expansions Raw expansions list. * * @return array */ private function getIndexSettings($synonyms, $expansions) { $settings = ['number_of_shards' => $this->indexSettingsHelper->getNumberOfShards(), 'number_of_replicas' => $this->indexSettingsHelper->getNumberOfReplicas(), 'requests.cache.enable' => true]; $settings['analysis']['filter']['shingle'] = ['type' => 'shingle', 'output_false' => true, 'token_separator' => ThesaurusIndex::WORD_DELIMITER]; $settings = $this->addAnalyzerSettings($settings, 'synonym', $synonyms); $settings = $this->addAnalyzerSettings($settings, 'expansion', $expansions); return $settings; }
/** * {@inheritDoc} */ public function getBatchIndexingSize() { return $this->helper->getBatchIndexingSize(); }
/** * Get cache tag by index identifier / store. * * @param string $indexIdentifier Index identifier. * @param string $storeId Store id. * * @return string[] */ private function getCacheTags($indexIdentifier, $storeId) { return [$this->indexSettingsHelper->getIndexAliasFromIdentifier($indexIdentifier, $storeId)]; }
/** * Returns the index alias used by store id. * * @param integer $storeId Store id. * * @return string */ private function getIndexAlias($storeId) { return $this->indexSettingsHelper->getIndexAliasFromIdentifier(self::INDEX_IDENTIER, $storeId); }