avoid indexing dupe data
authorBill Erickson <berickxx@gmail.com>
Mon, 30 Sep 2019 18:17:54 +0000 (14:17 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 17 Jan 2020 19:36:02 +0000 (14:36 -0500)
This came up when some test records had links to multiple metarecords,
causing the data to double-up on the join to the MR table.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib/Search.pm

index 70995f1..26d882b 100644 (file)
@@ -344,7 +344,7 @@ sub get_bib_data {
     my $ids_str = join(',', @$record_ids);
 
     my $sql = <<SQL;
-SELECT 
+SELECT DISTINCT ON (bre.id, search_group, name, value)
     bre.id, 
     bre.create_date, 
     bre.edit_date,