From c09cc669da0aac264f0bc44bddc3634e26f8c1c9 Mon Sep 17 00:00:00 2001 From: Stefan Hagspiel Date: Fri, 9 Feb 2024 11:15:27 +0100 Subject: [PATCH] pass locale to lucene index in multi search context --- UPGRADE.md | 3 +++ src/OutputChannel/MultiSearchOutputChannel.php | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/UPGRADE.md b/UPGRADE.md index c539d04..8b43530 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,8 @@ # Upgrade Notes +## 3.0.2 +- [BUGFIX] Pass locale to lucene index in multi search context + ## 3.0.1 - Fix ZendSearch Version Constraint diff --git a/src/OutputChannel/MultiSearchOutputChannel.php b/src/OutputChannel/MultiSearchOutputChannel.php index 2dac0cc..8cb0db2 100644 --- a/src/OutputChannel/MultiSearchOutputChannel.php +++ b/src/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 */