Skip to content

Solr Getting Started and Example

rdelbru edited this page Sep 7, 2011 · 11 revisions

Getting Started

This document covers the basics of running SIREn within Solr using an example schema, and some sample data.

We provide a solr configuration example which use SIREn for indexing and searching RDF data. The search interface is using the N-Triple query language.

Basic Steps

  1. Install Tomcat 6
  2. Stop tomcat
  3. Clean previously installed SIREn
  4. Configure Solr/SIREn webapp
  5. Copying context file
  6. Copying SIREn libs
  7. Change file permissions
  8. Start tomcat
  9. Load some data
  10. Run some queries

Install Tomcat 6

On Ubuntu, you can install tomcat using the following command:

> sudo apt-get install tomcat6

Stop Tomcat

Stop your tomcat instance before performing the following steps.

> /etc/init.d/tomcat6 stop

Clean previously install SIREn

In order to avoid unexpected conflict with previously deployed Solr webapp, remove siren webapp directory

> rm -rf $CATALINA_BASE/webapps/siren

Configure Solr/SIREn webapp

Edit siren.xml to set the path of the war file and SORL_HOME correctly using /your/local/path/siren-solr/example/solr as SOLR_HOME.

Copy context file

Copy siren.xml to:

$CATALINA_BASE/conf/Catalina/localhost/siren.xml

You may need to create that folder.

Copy SIREn libs

Build SIREn and copy siren-core-0.2.1-SNAPSHOT.jar, siren-qparser-0.2.1-SNAPSHOT.jar and siren-solr-0.2.1-SNAPSHOT.jar in SOLR_HOME/lib.

Change file permissions

Ensure that tomcat has full file permissions on SOLR_HOME:

> chown -R tomcat6:tomcat6 $SOLR_HOME

Start Tomcat

Start tomcat:

> /etc/init.d/tomcat6 start

You should be able to access the Solr admin page at http://localhost:8080/siren/

If you encounter problems, you can check the Solr logs at $CATALINA_BASE/logs/catalina.out.

Load some data

We provide a script to load three artificial documents. To load the three documents, just run the command:

> bash post.sh people.xml

If you go to the statistic page of the Solr admin interface, you should see the counter 'numDocs' equals to 3.

Run some queries

We provide a script which executes two queries and which displays the result in XML format. To execute the script, just run the command:

> bash query.sh

You can also go to the query form of the Solr admin interface. Replace 'standard' in the field "Query Type" by 'siren' to activate the SIREn query parser. You can now enter a keyword query. However, you cannot try N-Triple queries as the Solr admin query form does not support it.