From 9aeb154a32849649ac3722c52106d9abd8ec5c07 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 22 May 2019 14:35:56 -0700 Subject: count linked refs (not just raw refs) in elasticsearch --- python/fatcat_tools/transforms/elasticsearch.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'python/fatcat_tools/transforms/elasticsearch.py') diff --git a/python/fatcat_tools/transforms/elasticsearch.py b/python/fatcat_tools/transforms/elasticsearch.py index 7f7f2f1b..c150572e 100644 --- a/python/fatcat_tools/transforms/elasticsearch.py +++ b/python/fatcat_tools/transforms/elasticsearch.py @@ -84,6 +84,9 @@ def release_to_elasticsearch(entity, force_bool=True): t['any_abstract'] = len(release.abstracts or []) > 0 t['ref_count'] = len(release.refs or []) + t['ref_linked_count'] = 0 + if release.refs: + t['ref_linked_count'] = len([1 for ref in release.refs if ref.target_release_id]) t['contrib_count'] = len(release.contribs or []) contrib_names = [] creator_ids = [] -- cgit v1.2.3