From d66e4c0b9f57d77896a0ba6c16f289d5eaf64e89 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Wed, 20 Nov 2024 08:08:15 -0500 Subject: [PATCH] Fix web search highlighting broken by #3610. (#4092) --- .../src/VuFind/Search/Factory/SolrWebBackendFactory.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module/VuFind/src/VuFind/Search/Factory/SolrWebBackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/SolrWebBackendFactory.php index c1932a1fc27..9729716922f 100644 --- a/module/VuFind/src/VuFind/Search/Factory/SolrWebBackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/SolrWebBackendFactory.php @@ -64,8 +64,14 @@ protected function getCreateRecordCallback(): ?callable $manager = $this->serviceLocator ->get(\VuFind\RecordDriver\PluginManager::class); return function ($data) use ($manager) { + // Extract highlighting details injected earlier by + // \VuFindSearch\Backend\Solr\Response\Json\RecordCollectionFactory + $hl = $data['__highlight_details'] ?? []; + unset($data['__highlight_details']); + $driver = $manager->get('SolrWeb'); $driver->setRawData($data); + $driver->setHighlightDetails($hl); return $driver; }; }