From 4ef97d5d596cfb6f36776e971e2162e8144d32a9 Mon Sep 17 00:00:00 2001 From: Kristian Garza Date: Thu, 28 Nov 2019 13:11:20 +0100 Subject: [PATCH] don't collapse events --- app/queries/events_query.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/queries/events_query.rb b/app/queries/events_query.rb index 91f0a4ea7..4c111d248 100644 --- a/app/queries/events_query.rb +++ b/app/queries/events_query.rb @@ -22,7 +22,7 @@ def initialize() def doi_citations(doi) pid = Event.new.normalize_doi(doi) query = "(subj_id:\"#{pid}\" AND (relation_type_id:#{PASSIVE_RELATION_TYPES.join(' OR relation_type_id:')})) OR (obj_id:\"#{pid}\" AND (relation_type_id:#{ACTIVE_RELATION_TYPES.join(' OR relation_type_id:')}))" - results = Event.query(query, doi:doi, aggregations: "citation_count_aggregation", unqiue: true).response.aggregations.citations.buckets + results = Event.query(query, doi:doi, aggregations: "citation_count_aggregation", page: { size: 1, cursor: [] }).response.aggregations.citations.buckets results.any? ? results.first.total.value : 0 end