mirror of
https://github.com/alanorth/cgspace-notes.git
synced 2024-12-18 11:12:18 +01:00
1.6 KiB
1.6 KiB
title | date | author | categories | |
---|---|---|---|---|
December, 2024 | 2024-12-04T10:19:00+03:00 | Alan Orth |
|
2024-12-04
- We need to get view and download statistics for the last year from CGSpace
- The only way to get that is using Solr
- After consulting the Solr documentation I came up with this facet query:
facet.range=time&facet.range.start=NOW/MONTH-11MONTHS&facet.range.end=NOW/MONTH+1MONTH&facet.range.gap=+1MONTH
- This StackOverflow answer helped too, recommending
NOW/MONTH
to get neatly bucketed months because this will use the beginning of the current month - For views, I added the following query parameters:
q=type:2&fq=-isBot:true AND statistics_type:view
- For downloads I added the following query parameters:
q=type:0&fq=-isBot:true AND statistics_type:view AND bundleName:ORIGINAL