1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2024-11-25 15:48:20 +01:00

dspace_statistics_api/indexer.py: Use fl parameter

When indexing item views and downloads the only field we need is the
the id. The `fl` parameter tells Solr which fields to return in the
search results. This should theoretically be more efficient, though
I don't have any time to figure out how to measure it right now.
This commit is contained in:
Alan Orth 2020-12-17 12:22:10 +02:00
parent f3a0e3a671
commit 2407aeec70
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -47,6 +47,7 @@ def index_views():
solr_query_params = { solr_query_params = {
"q": "type:2", "q": "type:2",
"fq": "-isBot:true AND statistics_type:view", "fq": "-isBot:true AND statistics_type:view",
"fl": "id",
"facet": "true", "facet": "true",
"facet.field": "id", "facet.field": "id",
"facet.mincount": 1, "facet.mincount": 1,
@ -93,6 +94,7 @@ def index_views():
solr_query_params = { solr_query_params = {
"q": "type:2", "q": "type:2",
"fq": "-isBot:true AND statistics_type:view", "fq": "-isBot:true AND statistics_type:view",
"fl": "id",
"facet": "true", "facet": "true",
"facet.field": "id", "facet.field": "id",
"facet.mincount": 1, "facet.mincount": 1,