/** * {@inheritDoc} */ public function getSpellingType(RequestInterface $request) { $cacheKey = $this->getCacheKey($request); $spellingType = $this->cacheHelper->loadCache($cacheKey); if ($spellingType === false) { $spellingType = $this->loadSpellingType($request); $this->cacheHelper->saveCache($cacheKey, $spellingType, [$request->getIndex()]); } return $spellingType; }
/** * Provides weigthed rewrites for the query. * * @param ContainerConfigurationInterface $containerConfig Search request container config. * @param string $queryText Fulltext query. * * @return array */ public function getQueryRewrites(ContainerConfigurationInterface $containerConfig, $queryText) { $cacheKey = $this->getCacheKey($containerConfig, $queryText); $cacheTags = $this->getCacheTags($containerConfig); $queryRewrites = $this->cacheHelper->loadCache($cacheKey); if ($queryRewrites === false) { $queryRewrites = $this->computeQueryRewrites($containerConfig, $queryText); $this->cacheHelper->saveCache($cacheKey, $queryRewrites, $cacheTags); } return $queryRewrites; }