Solr GraphDB Connector

compared with
Current by Nikola Petrov
on May 12, 2015 14:49.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (10)

View Page History
h2. Solr deployment

h6. Solr extension

In order to be able to create new Solr cores on the fly you have to use the custom admin handler provided with the Solr Connector. The admin handler has to be added to Solr:

* Get the solr-extension jar from the GraphDB distribution and copy it <solr-home>.
* Tell Solr to scan the jar and use our custom handler instead of the default one - add the following lines to the root *solr* tag in solr.xml in <solr-home>:
You have two ways to get solr-extension jar:
* Through maven(if you have access to our internal repository). The artifact has the following maven configuration:
{code}
<dependency>
<groupId>com.ontotext.graphdb.plugins</groupId>
<artifactId>solr-core-admin-handler</artifactId>
<version>${connectors.version}</version>
</dependency>
{code}
* If you only have the zip distribution you can find the solr-extension jar in the tools subdirectory


Now copy the jar in <solr-home> and tell Solr to scan the jar and use our custom handler instead of the default one. Add the following lines to the root *solr* tag in solr.xml in <solr-home>:
{code}
<str name="adminHandler">org.apache.solr.handler.admin.ExtendedCoreAdminHandler</str> name="adminHandler">com.ontotext.solr.handler.admin.GraphDBConnectorAdminHandler</str>
<str name="sharedLib">${sharedLib:}</str>
{code}

The GraphDB distribution also provides a completely <solr-home> that you can extract at a convenient place and then use it to run Solr.
{note}
Note that this is a limitation of Solr and you are not required to use the custom handler. If you don't want to deploy it, then you will be responsible for creating the Solr core yourself.
{note}

Note that this is a limitation of Solr and you are not required to use the custom handler. However, in that case you will be responsible for creating the Solr core yourself.
h6. Solr schema setup

To use the connector, the core's schema from which we are going to copy the configuration(most of the time named collection1) should be configured properly:

* allow schema modifications(it should be [managed and mutable|https://cwiki.apache.org/confluence/display/solr/Managed+Schema+Definition+in+SolrConfig])
* the id should be configured to be a long. Include the following in the core's schema.xml from which you are going to copy new cores
{code}
<field name="id" type="long" indexed="true" stored="true" required="true" multiValued="false"/>
{code}

h6. Further configurations

The GraphDB distribution also provides a complete <solr-home> that you can extract at a convenient place and then use it to run Solr.


h1. Caveats