diff --git a/module/VuFind/src/VuFind/Search/Solr/DeduplicationListener.php b/module/VuFind/src/VuFind/Search/Solr/DeduplicationListener.php index 886c04e5b3cf3d25522f2ca08af8256852d04a10..33bf88a354b1c58aadf28e9cd4995ee7b002947d 100644 --- a/module/VuFind/src/VuFind/Search/Solr/DeduplicationListener.php +++ b/module/VuFind/src/VuFind/Search/Solr/DeduplicationListener.php @@ -339,17 +339,19 @@ class DeduplicationListener { $result = []; foreach ($params->get('fq') as $fq) { - if (preg_match( - '/\bbuilding:"([^"]+)"/', //'/\bbuilding:"?\d+\/([^\/]+?)\//', + if (preg_match_all( + '/\bbuilding:"([^"]+)"/', $fq, $matches )) { - $value = $matches[1]; - if (preg_match('/^\d+\/([^\/]+?)\//', $value, $matches)) { - // Hierarchical facets; take only first level: - $result[] = $matches[1]; - } else { - $result[] = $value; + $values = $matches[1]; + foreach ($values as $value) { + if (preg_match('/^\d+\/([^\/]+?)\//', $value, $matches)) { + // Hierarchical facets; take only first level: + $result[] = $matches[1]; + } else { + $result[] = $value; + } } } }