diff --git a/module/VuFind/src/VuFind/Search/Factory/SolrWebBackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/SolrWebBackendFactory.php index 68a4abd6eff..4d00452bf40 100644 --- a/module/VuFind/src/VuFind/Search/Factory/SolrWebBackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/SolrWebBackendFactory.php @@ -63,8 +63,14 @@ protected function getCreateRecordCallback(): ?callable { $manager = $this->getService(\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; }; }