mirror of
https://github.com/ilri/dspace-statistics-api.git
synced 2024-11-22 14:25:01 +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:
parent
57faec59c8
commit
a87aaba812
2
app.py
2
app.py
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user