Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
minLevel2

Excerpt
 

Solr in DSpace

What is Solr: http://lucene.apache.org/solr/features.html

...

Warning

Before you try to follow the advice below to bypass the localhost restriction, please note:

  • Exposing the Solr interface means, that any restricted metadata such as dc.description.provenance and non-anonymized usage statistics (client IPs, user agent strings) will be accessible.
  • Exposing the Solr interface also means that it will be exposed for write access. There is no easy way to expose only read access.
  • Never expose Solr to the internet. If you're exposing it to an IP within your network, add it as an exception to the LocalHostRestrictionFilter. If you have to expose Solr to a public IP, use a SSH tunnel or a VPN for the connection.

 


Bypassing localhost restriction temporarily

...

Starting from DSpace 3, there is a statistics_type field in the statistics core that contains the "usage event type". Currently, the available types are search, viewsearch_result and workflow. Here's how to get event breakdown by type, excluding robots (isBot:false):

 


Code Block
http://localhost:8080/solr/statistics/select?indent=on&rows=0&facet=true&facet.field=statistics_type&q=isBot:false

...

Code Block
http://localhost:8080/solr/statistics/select?indent=on&rows=0&facet=true&facet.date=time&facet.date.start=2016-01-01T00:00:00Z&facet.date.end=2017-01-01T00:00:00Z&facet.date.gap=%2B1MONTH&q=type:0+owningItem:2163&fq=-isBot:true&fq=-(bundleName:[*+TO+*]-bundleName:ORIGINAL)&fq=-(statistics_type:[*+TO+*]+-statistics_type:view)

Statistics: number of total downloads in a given time span

Show the total repository-wide bitstream (type:0) downloads, excluding robots (isBot:false), for a specific duration (September 1 2017 through September 1 2018).  No need for faceting to get a total count:

Code Block
http://localhost:8080/solr/statistics/select?indent=on&rows=0&q=time:[2017-09-01T00:00:00Z+TO+2018-09-01T00:00:00Z]+AND+type:0+AND+isBot:false

Querying Solr from XMLUI

Since Solr returns its responses in XML, it's possible and easy to call custom Solr queries from XMLUI, process the XML response with XSLT and display the results in human-readable form on the HTML page.
There are two ways how to do that - synchronously in Cocoon or asynchronously using AJAX (JavaScript) after the page is loaded. Solr queries are usually very fast, so only synchronous calls will be shown here.

...

  • Discovery Official DSpace 3.x documentation
  • DSpace Discovery Discovery proposal & purpose, intro video, Discovery 1.8 changes & configuration
  • DSpace Discovery HowTo Discovery screenshots (before Discovery was included in DSpace), most content obsolete (pre-1.7.0)

See also:

  • Solr Tutorial
  • ajax-solr, a JavaScript library for creating user interfaces to Solr.
  • /var/log/tomcat6/catalina.out