Skip to content
Snippets Groups Projects
Commit 70554a0e authored by Ere Maijala's avatar Ere Maijala
Browse files

Fixed filter query parsing in deduplication listener.

parent 2deca05c
No related merge requests found
...@@ -317,16 +317,17 @@ class DeduplicationListener ...@@ -317,16 +317,17 @@ class DeduplicationListener
{ {
$result = []; $result = [];
foreach ($params->get('fq') as $fq) { foreach ($params->get('fq') as $fq) {
if (strncmp($fq, 'building:', 9) == 0) { if (preg_match(
if (preg_match( '/\bbuilding:"([^"]+)"/', //'/\bbuilding:"?\d+\/([^\/]+?)\//',
'/^building:"?\d+\/([^\/]+?)\//', $fq,
$fq, $matches
$matches )) {
)) { $value = $matches[1];
if (preg_match('/^\d+\/([^\/]+?)\//', $value, $matches)) {
// Hierarchical facets; take only first level: // Hierarchical facets; take only first level:
$result[] = $matches[1]; $result[] = $matches[1];
} else { } else {
$result[] = substr($fq, 12); $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