1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2024-11-25 23:58:18 +01:00

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.
This commit is contained in:
Alan Orth 2018-09-19 00:24:23 +03:00
parent 57faec59c8
commit a87aaba812
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

2
app.py
View File

@ -27,7 +27,7 @@ class ItemResource:
# Get downloads # Get downloads
res = solr.query(SOLR_CORE, { res = solr.query(SOLR_CORE, {
'q':'type:0', '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() downloads = res.get_num_found()