mirror of
https://github.com/ilri/dspace-statistics-api.git
synced 2024-12-22 12:42:19 +01:00
app.py: Use rows=0 for Solr queries
There is no need to return any rows of the result because I am only interested in the numFound.
This commit is contained in:
parent
24af83b03f
commit
8e29fd8a43
6
app.py
6
app.py
@ -19,7 +19,8 @@ class ItemResource:
|
||||
# Get views
|
||||
res = solr.query(SOLR_CORE, {
|
||||
'q':'type:0',
|
||||
'fq':'owningItem:{0} AND isBot:false AND statistics_type:view AND -bundleName:ORIGINAL'.format(item_id)
|
||||
'fq':'owningItem:{0} AND isBot:false AND statistics_type:view AND -bundleName:ORIGINAL'.format(item_id),
|
||||
'rows':0
|
||||
})
|
||||
|
||||
views = res.get_num_found()
|
||||
@ -27,7 +28,8 @@ class ItemResource:
|
||||
# Get downloads
|
||||
res = solr.query(SOLR_CORE, {
|
||||
'q':'type:0',
|
||||
'fq':'owningItem:{0} AND isBot:false AND statistics_type:view AND bundleName:ORIGINAL'.format(item_id)
|
||||
'fq':'owningItem:{0} AND isBot:false AND statistics_type:view AND bundleName:ORIGINAL'.format(item_id),
|
||||
'rows':0
|
||||
})
|
||||
|
||||
downloads = res.get_num_found()
|
||||
|
Loading…
Reference in New Issue
Block a user