Skip to content

Commit

Permalink
Merge branch '2.11.x' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
romainruaud committed Jul 23, 2024
2 parents a4adea5 + dc92228 commit e34ecd8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public function create(ContainerConfigurationInterface $containerConfig, $queryT
$relevanceConfig = $containerConfig->getRelevanceConfig();
if ($relevanceConfig->getSpanMatchBoost()) {
$spanQuery = $this->getSpanQuery($containerConfig, $queryText, $relevanceConfig->getSpanMatchBoost());
$spanQuery->setName('SPAN');
if ($spanQuery !== null) {
$spanQuery->setName('SPAN');
$queryParams = [
'must' => [$query],
'should' => [$spanQuery],
Expand Down
5 changes: 3 additions & 2 deletions src/module-elasticsuite-thesaurus/Model/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,9 @@ private function getCacheKey(ContainerConfigurationInterface $containerConfig, $
private function getCacheTags(ContainerConfigurationInterface $containerConfig)
{
$storeId = $containerConfig->getStoreId();
$containerName = $containerConfig->getName();

return [$this->getIndexAlias($storeId)];
return [$this->getIndexAlias($storeId), $containerName];
}

/**
Expand Down Expand Up @@ -217,7 +218,7 @@ private function getConfig(ContainerConfigurationInterface $containerConfig)
private function getSynonymRewrites($storeId, $queryText, $type, $maxRewrites)
{
$indexName = $this->getIndexAlias($storeId);
$analyzedQueries = $this->getQueryCombinations($storeId, $queryText);
$analyzedQueries = $this->getQueryCombinations($storeId, str_replace('-', ' ', $queryText));
$synonyms = [];

foreach ($analyzedQueries as $query) {
Expand Down
11 changes: 10 additions & 1 deletion src/module-elasticsuite-virtual-category/Model/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,16 @@ private function getVirtualCategoryQuery(
$excludedCategories = []
): ?QueryInterface {
$rootCategory = $this->getVirtualRootCategory($category);
if ($rootCategory && in_array($rootCategory->getId(), $excludedCategories)) {
// If the root category of the current virtual category has already been computed (exist in $excludedCategories)
// or if a parent of the root category of the current category has already been computed we don't need
// to compute the rule. All the product will already been present.
// For example, if you have the following category tree:
// - Category A (static)
// - - Category B (static)
// - - Category C (virtual with category B as root)
// When you compute the rule of the category A you do not need to compute the rule of the category C
// as all the product will be there.
if ($rootCategory && array_intersect(explode('/', $rootCategory->getPath()), $excludedCategories)) {
return null;
}

Expand Down

0 comments on commit e34ecd8

Please sign in to comment.