dspace_statistics_api/indexer.py: Fix minor issues raised by flake8

This commit is contained in:
Alan Orth 2019-11-27 12:12:05 +02:00
parent 3540ce328b
commit eeb8e6bba1
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
1 changed files with 3 additions and 4 deletions

View File

@ -31,7 +31,6 @@
from .config import SOLR_SERVER from .config import SOLR_SERVER
from .database import DatabaseManager from .database import DatabaseManager
import json
import psycopg2.extras import psycopg2.extras
import re import re
import requests import requests
@ -146,7 +145,7 @@ def index_views():
'shards': shards, 'shards': shards,
'rows': 0, 'rows': 0,
'wt': 'json', 'wt': 'json',
'json.nl': 'map' # return facets as a dict instead of a flat list 'json.nl': 'map' # return facets as a dict instead of a flat list
} }
solr_url = SOLR_SERVER + '/statistics/select' solr_url = SOLR_SERVER + '/statistics/select'
@ -172,7 +171,7 @@ def index_views():
def index_downloads(): def index_downloads():
# get the total number of distinct facets for items with at least 1 download # get the total number of distinct facets for items with at least 1 download
solr_query_params= { solr_query_params = {
'q': 'type:0', 'q': 'type:0',
'fq': 'isBot:false AND statistics_type:view AND bundleName:ORIGINAL', 'fq': 'isBot:false AND statistics_type:view AND bundleName:ORIGINAL',
'facet': 'true', 'facet': 'true',
@ -225,7 +224,7 @@ def index_downloads():
'shards': shards, 'shards': shards,
'rows': 0, 'rows': 0,
'wt': 'json', 'wt': 'json',
'json.nl': 'map' # return facets as a dict instead of a flat list 'json.nl': 'map' # return facets as a dict instead of a flat list
} }
solr_url = SOLR_SERVER + '/statistics/select' solr_url = SOLR_SERVER + '/statistics/select'