dspace_statistics_api/stats.py: Use -isBot:true
continuous-integration/drone/push Build is passing Details

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
1 changed files with 2 additions and 2 deletions

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,