SUNScholar/Statistics/5.X

Back to Default Statistics

PLEASE NOTE:
After upgrading from 4.2 and testing, the following error was thrown in the Tomcat "catalina.out" log file: solr.server not defined I checked the config files below and all looked ok.

The I checked the "build.properties" file and changed: solr.server=http://localhost/solr to solr.server = http://localhost/solr All I did was properly add spaces around the equals sign. And rebuilt DSpace. Then default SOLR stats worked again.

See: http://wiki.lib.sun.ac.za/index.php/Install_DSpace/S04/5.X#Example_Config for an example DSpace "build.properties" file.

Step 1 - Setup SOLR config file
Edit the following file: nano $HOME/ source /dspace/config/modules/solr-statistics.cfg See example below.
 * 1) --SOLR STATISTICS CONFIGURATIONS---#
 * 2) These configs are only used by the SOLR interface/webapp to   #
 * 3) track usage statistics.                                       #
 * 1) These configs are only used by the SOLR interface/webapp to   #
 * 2) track usage statistics.                                       #

server = ${solr.server}/statistics
 * 1) Usage Logging #####
 * 2) set this to be the port you run the dspace "solr" webapp
 * on, by default, we are assuming a test configuration with
 * 1) tomcat still running on port 8080

query.filter.bundles=ORIGINAL
 * 1) A comma-separated list that contains the bundles for which the bitstreams will be displayed


 * 1) control solr statistics querying to filter out spider IPs
 * 2) false by default
 * 3) query.filter.spiderIp = false


 * 1) control solr statistics querying to look at "isBot" field to determine
 * 2) if record is a bot. true by default.
 * 3) query.filter.isBot = true

spiderips.urls = http://iplists.com/google.txt, \ http://iplists.com/inktomi.txt, \ http://iplists.com/lycos.txt, \ http://iplists.com/infoseek.txt, \ http://iplists.com/altavista.txt, \ http://iplists.com/excite.txt, \ http://iplists.com/misc.txt, \ http://iplists.com/non_engines.txt
 * 1) URLs to download IP addresses of search engine spiders from

Step 2 - Setup usage config file
Edit the following file: nano $HOME/ source /dspace/config/modules/usage-statistics.cfg See example below. dbfile = ${dspace.dir}/config/GeoLiteCity.dat
 * 1) The location for the Geo Database retrieved on update/installation

resolver.timeout = 1000
 * 1) Timeout for the resolver in the DNS lookup
 * 2) Time in milliseconds, defaults to 200 for backward compatibility
 * 3) Your system's default is usually set in /etc/resolv.conf and varies
 * 4) between 2 to 5 seconds, too high a value might result in Solr exhausting
 * 5) your connection pool

authorization.admin.usage=false authorization.admin.search=false authorization.admin.workflow=false
 * 1) Control if the statistics pages should be only shown to authorized users
 * 2) If enabled, only the administrators for the DSpaceObject will be able to
 * 3) view the statistics.
 * 4) If disabled, anyone with READ permissions on the DSpaceObject will be able
 * 5) to view the statistics.
 * 6) View/download statistics
 * 1) Search/search result statistics
 * 1) Workflow result statistics

logBots = false
 * 1) Enable/disable logging of spiders in solr statistics.
 * 2) If false, and IP matches an address in spiderips.urls, event is not logged.
 * 3) If true, event will be logged with the 'isBot' field set to true
 * 4) (see query.filter.* for query filter options)
 * 5) Default value is true.

Step 3 - Enable new configuration
To enable the new configuration, you would normally rebuild DSpace.

Step 4 - Re-index statistics
If you are upgrading, then you are required re-index the SOLR statistics.

Prepare the "temp" folder. mkdir $HOME/temp

chmod 0777 -R $HOME/temp Then run the following script: sudo $HOME/bin/dspace solr-reindex-statistics Please note:
 * This may take a very long time if there are many years worth of statistics data to re-index.
 * To put a long running task into background mode, see: http://www.kossboss.com/linux---move-running-to-process-nohup

Step 5 - Enable daily stats optimisation

 * 1) Go to: http://wiki.lib.sun.ac.za/index.php/SUNScholar/Daily_Admin
 * 2) Check all the options for stats-util and enable.