From 385ff2901acf6e06aaabacddaee6e8fb268a161c Mon Sep 17 00:00:00 2001 From: Stefan Hagspiel Date: Fri, 9 Feb 2024 10:55:31 +0100 Subject: [PATCH] pass locale to lucene index in multi search context --- .github/workflows/codeception.yml | 4 ++-- .github/workflows/ecs.yml | 4 ++-- .github/workflows/php-stan.yml | 4 ++-- UPGRADE.md | 3 +++ src/DsLuceneBundle/OutputChannel/MultiSearchOutputChannel.php | 3 ++- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codeception.yml b/.github/workflows/codeception.yml index cdcfafd..9eed081 100644 --- a/.github/workflows/codeception.yml +++ b/.github/workflows/codeception.yml @@ -1,9 +1,9 @@ name: Codeception on: push: - branches: [ 'master' ] + branches: [ '2.x' ] pull_request: - branches: [ 'master' ] + branches: [ '2.x' ] jobs: codeception: diff --git a/.github/workflows/ecs.yml b/.github/workflows/ecs.yml index 5bba293..6c2efe2 100644 --- a/.github/workflows/ecs.yml +++ b/.github/workflows/ecs.yml @@ -1,9 +1,9 @@ name: Easy Coding Standards on: push: - branches: [ 'master' ] + branches: [ '2.x' ] pull_request: - branches: [ 'master' ] + branches: [ '2.x' ] jobs: ecs: diff --git a/.github/workflows/php-stan.yml b/.github/workflows/php-stan.yml index f39c5a2..683fa25 100644 --- a/.github/workflows/php-stan.yml +++ b/.github/workflows/php-stan.yml @@ -1,9 +1,9 @@ name: PHP Stan on: push: - branches: [ 'master' ] + branches: [ '2.x' ] pull_request: - branches: [ 'master' ] + branches: [ '2.x' ] jobs: stan: diff --git a/UPGRADE.md b/UPGRADE.md index 93fa437..a94e079 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,8 @@ # Upgrade Notes +## 2.0.2 +- [BUGFIX] Pass locale to lucene index in multi search context + ## 2.0.1 - [BUGFIX] SnowBallStemmingFilter uses not initialized locale [#15](https://github.com/dachcom-digital/pimcore-dynamic-search-index-provider-lucene/issues/15) - [BUGFIX] basePath is scalar node, not boolean [@dpfaffenbauer](https://github.com/dachcom-digital/pimcore-dynamic-search-index-provider-lucene/pull/14) diff --git a/src/DsLuceneBundle/OutputChannel/MultiSearchOutputChannel.php b/src/DsLuceneBundle/OutputChannel/MultiSearchOutputChannel.php index 2dac0cc..8cb0db2 100644 --- a/src/DsLuceneBundle/OutputChannel/MultiSearchOutputChannel.php +++ b/src/DsLuceneBundle/OutputChannel/MultiSearchOutputChannel.php @@ -61,6 +61,7 @@ public function getResult(SearchContainerInterface $searchContainer): SearchCont public function getMultiSearchResult(MultiSearchContainerInterface $multiSearchContainer): MultiSearchContainerInterface { + $userLocale = $this->outputChannelContext->getRuntimeQueryProvider()->getUserLocale(); $indexProviderOptions = $this->outputChannelContext->getIndexProviderOptions(); foreach ($multiSearchContainer->getSearchContainer() as $searchContainer) { @@ -68,7 +69,7 @@ public function getMultiSearchResult(MultiSearchContainerInterface $multiSearchC $query = $searchContainer->getQuery(); $eventData = $this->eventDispatcher->dispatchAction('build_index', [ - 'index' => $this->storageBuilder->getLuceneIndex($indexProviderOptions, ConfigurationInterface::INDEX_BASE_STABLE) + 'index' => $this->storageBuilder->getLuceneIndex($indexProviderOptions, ConfigurationInterface::INDEX_BASE_STABLE, $userLocale) ]); /** @var Lucene\SearchIndexInterface $index */