1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2024-11-25 07:40:17 +01:00

dspace_statistics_api/stats.py: Use -isBot:true
All checks were successful
continuous-integration/drone/push Build is passing

Minor change to bot filtering. We should use a negated match for
documents that have `isBot:true` rather than looking for documents
that are tagged with `isBot:false` (the distinction is subtle, but
important).
This commit is contained in:
Alan Orth 2020-12-20 16:56:03 +02:00
parent 8a1244d2d0
commit ab82e90773
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -21,7 +21,7 @@ def get_views(solr_date_string: str, elements: list, facetField: str):
solr_query_params = {
"q": f"{facetField}:({solr_elements_string})",
"fq": f"type:2 AND isBot:false AND statistics_type:view AND time:{solr_date_string}",
"fq": f"type:2 AND -isBot:true AND statistics_type:view AND time:{solr_date_string}",
"fl": facetField,
"facet": "true",
"facet.field": facetField,
@ -83,7 +83,7 @@ def get_downloads(solr_date_string: str, elements: list, facetField: str):
solr_query_params = {
"q": f"{facetField}:({solr_elements_string})",
"fq": f"type:0 AND isBot:false AND statistics_type:view AND bundleName:ORIGINAL AND time:{solr_date_string}",
"fq": f"type:0 AND -isBot:true AND statistics_type:view AND bundleName:ORIGINAL AND time:{solr_date_string}",
"fl": facetField,
"facet": "true",
"facet.field": facetField,