mirror of
https://github.com/ilri/dspace-statistics-api.git
synced 2024-11-22 14:25:01 +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
|
# Get views
|
||||||
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: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()
|
views = res.get_num_found()
|
||||||
@ -27,7 +28,8 @@ 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: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()
|
downloads = res.get_num_found()
|
||||||
|
Loading…
Reference in New Issue
Block a user