From 0c2eadae5d4360eca1003ba99533103cec998a1e Mon Sep 17 00:00:00 2001 From: Marcos Lopez Gonzalez Date: Wed, 8 Jan 2025 15:46:33 +0100 Subject: [PATCH] #644 facets were returning results from deleted descriptor groups --- .../mapper/collections/CollectionsSearchMapper.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/registry-persistence/src/main/resources/org/gbif/registry/persistence/mapper/collections/CollectionsSearchMapper.xml b/registry-persistence/src/main/resources/org/gbif/registry/persistence/mapper/collections/CollectionsSearchMapper.xml index 102141c0e..51e1d8d71 100644 --- a/registry-persistence/src/main/resources/org/gbif/registry/persistence/mapper/collections/CollectionsSearchMapper.xml +++ b/registry-persistence/src/main/resources/org/gbif/registry/persistence/mapper/collections/CollectionsSearchMapper.xml @@ -531,7 +531,7 @@ LEFT JOIN address ma ON ma.key = c.mailing_address_key - INNER JOIN collection_descriptor_group cdg ON cdg.collection_key = c.key + INNER JOIN collection_descriptor_group cdg ON cdg.collection_key = c.key AND cdg.deleted IS NULL INNER JOIN collection_descriptor cd ON cd.collection_descriptor_group_key = cdg.key @@ -621,7 +621,7 @@ COUNT(DISTINCT CASE WHEN a.${params.facet.name} is not null THEN a.${params.facet.name} ELSE ma.${params.facet.name} END) FROM collection c - INNER JOIN collection_descriptor_group cdg ON cdg.collection_key = c.key + INNER JOIN collection_descriptor_group cdg ON cdg.collection_key = c.key AND cdg.deleted IS NULL INNER JOIN collection_descriptor cd ON cd.collection_descriptor_group_key = cdg.key @@ -632,7 +632,7 @@ COUNT(DISTINCT facet) FROM collection c - INNER JOIN collection_descriptor_group cdg ON cdg.collection_key = c.key + INNER JOIN collection_descriptor_group cdg ON cdg.collection_key = c.key AND cdg.deleted IS NULL INNER JOIN collection_descriptor cd ON cd.collection_descriptor_group_key = cdg.key INNER JOIN unnest( @@ -691,7 +691,7 @@ ) FROM collection c - INNER JOIN collection_descriptor_group cdg ON cdg.collection_key = c.key + INNER JOIN collection_descriptor_group cdg ON cdg.collection_key = c.key AND cdg.deleted IS NULL INNER JOIN collection_descriptor cd ON cd.collection_descriptor_group_key = cdg.key