Skip to content
Snippets Groups Projects
Commit b8dcb31c authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Support multiple building filter values when determining source record...

Support multiple building filter values when determining source record priority with deduplicated records
- makes priority determination work with orFacets.
parent 48ee4a97
No related merge requests found
...@@ -339,17 +339,19 @@ class DeduplicationListener ...@@ -339,17 +339,19 @@ class DeduplicationListener
{ {
$result = []; $result = [];
foreach ($params->get('fq') as $fq) { foreach ($params->get('fq') as $fq) {
if (preg_match( if (preg_match_all(
'/\bbuilding:"([^"]+)"/', //'/\bbuilding:"?\d+\/([^\/]+?)\//', '/\bbuilding:"([^"]+)"/',
$fq, $fq,
$matches $matches
)) { )) {
$value = $matches[1]; $values = $matches[1];
if (preg_match('/^\d+\/([^\/]+?)\//', $value, $matches)) { foreach ($values as $value) {
// Hierarchical facets; take only first level: if (preg_match('/^\d+\/([^\/]+?)\//', $value, $matches)) {
$result[] = $matches[1]; // Hierarchical facets; take only first level:
} else { $result[] = $matches[1];
$result[] = $value; } else {
$result[] = $value;
}
} }
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment