Apache Solr Search Server

iKnowBase comes with ready-to-use components for integration with the Apache Solr open source enterprise search platform ( http://lucene.apache.org/solr/).

Installation

The Apache Solr Search Server is included in the iKnowBase distribution as a zip file including both Solr and iKnowBase configuration. To install, do the following:

Note: The iKnowBase search component, which handles security, requires Java version 7.

Starting and stopping

A start/stop script for linux is provided in <solr-home>/bin. It can be placed under /etc/init.d. Change the SOLR_RUNASUSER to the linux user who should run Apache Solr. To add Solr as a linux service, use the chkconfig tool.

Start Solr and use a web browser to see the Admin Console: http://hostname.example.com:8983/solr/admin. If Solr is not running, your browser will complain that it cannot connect to the server.

Configuration

Before use, the Solr-installation must be configured. Similarly, the iKnowBase applications that will index and search must be configured.

Security-plugin

iKnowBase ships with a Solr-plugin that verifies document access for all documents returned from the Solr search engine. The principles behind this plugin is that iKnowBase will add security information to the search query sent to Solr, which will then be intercepted by the Solr engine during search. For this to work, two items must be in place. First, the plugin must be able to connect to the iKnowBase database, and second, the iKnowBase viewer application and the Solr plugin must share a common secret used to encrypt the security information.

The common secret is handled by a secure token engine, which is itself configured in two steps. First, the secure key is stored in the installation_properties table in the database, using a property name of com.iknowbase.secureTokenEngine.secureKey and an instance_qualifier that can be used by the iKnowBase web application (a single star, “*”, will always work); then the Solr plugin must be informed about this qualifier, so that it can load the same value.

Configure the security component by filling in proper values for the following properties in solrcore.properties:

Property name Description
jdbcUrl This points to the database where iKnowBase is installed, eg. jdbc:oracle:thin:@//hostname.example.com:portnumber/service_name.
dbUsername The database-user where iKnowBase is installed.
dbPassword The password to the iKnowBase database user.
instanceQualifier The instance_qualifier used to look up the proper secure token engine configuration from installation_properties in the iKnowBase database.

SolrCloud

Apache Solr includes the ability to set up a cluster of Solr servers that combines fault tolerance and high availability. Called SolrCloud, these capabilities provide distributed indexing and search capabilities, supporting the following features:

SolrCloud is the preferred method when it comes to load balancing, fail-over and replication.

We refer to documentation from Apache Solr e.g https://cwiki.apache.org/confluence/display/solr/SolrCloud for more information on this.

Master-Slave setup

You may configure multiple Solr instances in a Master-Slave configuration, for example indexing is done on one node, while searching is done on another.
Read more about this in the Solr documentation, and configure the following properties in solrcore.properties:

Property name Description
enable.master If this is the master, this should be set to true.
enable.slave If this is a slave, this should be set to true.
masterUrl If this is a slave, this applies to the master Solr url with the core-name, eg. http://hostname.example.com:8983/solr/iknowbase.
pollInterval If this is a slave, this applies to the poll interval for the slave to check for updates of the index. Default is set to 60 seconds (00:00:60).

You will have to make this configuration for each node (master and slaves). The master will typically be used for indexing, while slave servers normally handles the search.

Configure the iKnowBase applications