28 private $queryCollection;
38 $this->scopeConfig = $scopeConfig;
39 $this->queryCollection = $queryCollection;
51 $terms = $this->queryCollection
53 ->setPageSize($this->getMaxCountCacheableSearchTerms(
$storeId))
55 ->getColumnValues(
'query_text');
57 return in_array($term, $terms);
66 private function getMaxCountCacheableSearchTerms(
int $storeId)
68 return $this->scopeConfig->getValue(
69 self::XML_PATH_MAX_COUNT_CACHEABLE_SEARCH_TERMS,
70 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
const XML_PATH_MAX_COUNT_CACHEABLE_SEARCH_TERMS
isCacheable(string $term, int $storeId)
__construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Search\Model\ResourceModel\Query\Collection $queryCollection)