-
Notifications
You must be signed in to change notification settings - Fork 36
Solr Getting Started and Example
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.
- Install Tomcat 6
- Stop tomcat
- Clean previously installed SIREn
- Configure Solr/SIREn webapp
- Copying context file
- Copying SIREn libs
- Change file permissions
- Start tomcat
- Load some data
- Run some queries
On Ubuntu, you can install tomcat using the following command:
> sudo apt-get install tomcat6
Stop your tomcat instance before performing the following steps.
> /etc/init.d/tomcat6 stop
In order to avoid unexpected conflict with previously deployed Solr webapp, remove siren webapp directory
> rm -rf $CATALINA_BASE/webapps/siren
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 siren.xml to:
$CATALINA_BASE/conf/Catalina/localhost/siren.xml
You may need to create that folder.
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.
Ensure that tomcat has full file permissions on SOLR_HOME:
> chown -R tomcat6:tomcat6 $SOLR_HOME
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.
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.
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
-
Query 1:
* <name> 'john AND gartner'
-
Query 2:
* <workplace> <galway> AND * <type> <student> AND * <age> "26"
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.