From a87aaba812878bd831655136ec05dba3cee5aa3e Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Wed, 19 Sep 2018 00:24:23 +0300 Subject: [PATCH] app.py: Simplify Solr query for bitstream downloads This whole business with negative query ranges is confusing as hell and I'll definitely forget it in the future. In DSpace's Solr term- inology a "download" is a view to some bitstream that lives in the ORIGINAL bundle. This is where bitstreams that are uploaded during the item submission process go, versus generated thumbnails, etc. --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 1ebf1c2..ff863b8 100644 --- a/app.py +++ b/app.py @@ -27,7 +27,7 @@ class ItemResource: # Get downloads res = solr.query(SOLR_CORE, { 'q':'type:0', - 'fq':'owningItem:{0} AND isBot:false AND statistics_type:view AND -(bundleName:[* TO *] -bundleName:ORIGINAL)'.format(item_id) + 'fq':'owningItem:{0} AND isBot:false AND statistics_type:view AND bundleName:ORIGINAL'.format(item_id) }) downloads = res.get_num_found()