mirror of
https://github.com/ilri/dspace-statistics-api.git
synced 2024-11-22 14:25:01 +01:00
Remove SOLR_CORE configuration variable
This parameter is not customizable. All DSpace instances use this name for the Solr statistics core.
This commit is contained in:
parent
89621af85d
commit
a51422273c
1
app.py
1
app.py
@ -2,7 +2,6 @@
|
|||||||
# See DSpace Solr docs for tips about parameters
|
# See DSpace Solr docs for tips about parameters
|
||||||
# https://wiki.duraspace.org/display/DSPACE/Solr
|
# https://wiki.duraspace.org/display/DSPACE/Solr
|
||||||
|
|
||||||
from config import SOLR_CORE
|
|
||||||
from database import database_connection_ro
|
from database import database_connection_ro
|
||||||
import falcon
|
import falcon
|
||||||
from solr import solr_connection
|
from solr import solr_connection
|
||||||
|
@ -2,7 +2,6 @@ import os
|
|||||||
|
|
||||||
# Check if Solr connection information was provided in the environment
|
# Check if Solr connection information was provided in the environment
|
||||||
SOLR_SERVER = os.environ.get('SOLR_SERVER', 'http://localhost:8080/solr')
|
SOLR_SERVER = os.environ.get('SOLR_SERVER', 'http://localhost:8080/solr')
|
||||||
SOLR_CORE = os.environ.get('SOLR_CORE', 'statistics')
|
|
||||||
|
|
||||||
SQLITE_DB = os.environ.get('SQLITE_DB', 'statistics.db')
|
SQLITE_DB = os.environ.get('SQLITE_DB', 'statistics.db')
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Environment=SOLR_SERVER=http://localhost:8081/solr
|
Environment=SOLR_SERVER=http://localhost:8081/solr
|
||||||
Environment=SOLR_CORE=statistics
|
|
||||||
User=nobody
|
User=nobody
|
||||||
Group=nogroup
|
Group=nogroup
|
||||||
WorkingDirectory=/opt/ilri/dspace-statistics-api
|
WorkingDirectory=/opt/ilri/dspace-statistics-api
|
||||||
|
@ -4,7 +4,6 @@ After=tomcat7.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Environment=SOLR_SERVER=http://localhost:8081/solr
|
Environment=SOLR_SERVER=http://localhost:8081/solr
|
||||||
Environment=SOLR_CORE=statistics
|
|
||||||
User=nobody
|
User=nobody
|
||||||
Group=nogroup
|
Group=nogroup
|
||||||
WorkingDirectory=/opt/ilri/cgspace-statistics-api
|
WorkingDirectory=/opt/ilri/cgspace-statistics-api
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
# See DSpace Solr docs for tips about parameters
|
# See DSpace Solr docs for tips about parameters
|
||||||
# https://wiki.duraspace.org/display/DSPACE/Solr
|
# https://wiki.duraspace.org/display/DSPACE/Solr
|
||||||
|
|
||||||
from config import SOLR_CORE
|
|
||||||
from database import database_connection_rw
|
from database import database_connection_rw
|
||||||
from solr import solr_connection
|
from solr import solr_connection
|
||||||
|
|
||||||
@ -12,7 +11,7 @@ def index_views():
|
|||||||
print("Populating database with item views.")
|
print("Populating database with item views.")
|
||||||
|
|
||||||
# determine the total number of items with views (aka Solr's numFound)
|
# determine the total number of items with views (aka Solr's numFound)
|
||||||
res = solr.query(SOLR_CORE, {
|
res = solr.query('statistics', {
|
||||||
'q':'type:2',
|
'q':'type:2',
|
||||||
'fq':'isBot:false AND statistics_type:view',
|
'fq':'isBot:false AND statistics_type:view',
|
||||||
'facet':True,
|
'facet':True,
|
||||||
@ -28,7 +27,7 @@ def index_views():
|
|||||||
while results_current_page <= results_num_pages:
|
while results_current_page <= results_num_pages:
|
||||||
print('Page {0} of {1}.'.format(results_current_page, results_num_pages))
|
print('Page {0} of {1}.'.format(results_current_page, results_num_pages))
|
||||||
|
|
||||||
res = solr.query(SOLR_CORE, {
|
res = solr.query('statistics', {
|
||||||
'q':'type:2',
|
'q':'type:2',
|
||||||
'fq':'isBot:false AND statistics_type:view',
|
'fq':'isBot:false AND statistics_type:view',
|
||||||
'facet':True,
|
'facet':True,
|
||||||
@ -53,7 +52,7 @@ def index_downloads():
|
|||||||
print("Populating database with item downloads.")
|
print("Populating database with item downloads.")
|
||||||
|
|
||||||
# determine the total number of items with downloads (aka Solr's numFound)
|
# determine the total number of items with downloads (aka Solr's numFound)
|
||||||
res = solr.query(SOLR_CORE, {
|
res = solr.query('statistics', {
|
||||||
'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,
|
||||||
@ -69,7 +68,7 @@ def index_downloads():
|
|||||||
while results_current_page <= results_num_pages:
|
while results_current_page <= results_num_pages:
|
||||||
print('Page {0} of {1}.'.format(results_current_page, results_num_pages))
|
print('Page {0} of {1}.'.format(results_current_page, results_num_pages))
|
||||||
|
|
||||||
res = solr.query(SOLR_CORE, {
|
res = solr.query('statistics', {
|
||||||
'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,
|
||||||
|
Loading…
Reference in New Issue
Block a user