Skip to content
Snippets Groups Projects
Commit 53c98814 authored by Demian Katz's avatar Demian Katz
Browse files

Merge pull request #321 from EreMaijala/dedup-fix

Fixed filter query parsing in deduplication listener.
parents 2deca05c 70554a0e
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