Configuring the Solr library path 

DataStax Enterprise does not support the relative path values that are defined as <lib> directives in solrconfig.xml. Steps to deploy a custom Solr query parser plugin and a workaround to find files in directories that are defined by the <lib> property.

The location for library files in DataStax Enterprise is not the same location as open source Solr. Contrary to the examples shown in the solrconfig.xml file that indicate support for relative paths, DataStax Enterprise does not support the relative path values for <lib> directives. DSE Search fails to find files in directories that are defined with the <lib> directive.

The workaround is to place the JAR file, custom code, or the Solr contrib modules in the Solr library directories.

The default Solr library path location depends on the type of installation:
Installer-Services /usr/share/dse/resources/solr/lib
Package installations /usr/share/dse/solr/lib
Installer-No Services and Tarball installations install_location/resources/solr/lib
When the plugin JAR file is not in the directory that is defined by the <lib> property. Attempts to deploy custom Solr libraries in DataStax Enterprise fail with java.lang.ClassNotFoundException and an error in the system.log like this:
ERROR [http-8983-exec-5] 2015-12-06 16:32:33,992 CoreContainer.java (line 956) Unable to create core: boogle.main 
org.apache.solr.common.SolrException: Error loading class 'com.boogle.search.CustomQParserPlugin' 
at org.apache.solr.core.SolrCore.(SolrCore.java:851) 
at org.apache.solr.core.SolrCore.(SolrCore.java:640) 
at com.datastax.bdp.search.solr.core.CassandraCoreContainer.doCreate(CassandraCoreContainer.java:675) 
at com.datastax.bdp.search.solr.core.CassandraCoreContainer.create(CassandraCoreContainer.java:234) 
at com.datastax.bdp.search.solr.core.SolrCoreResourceManager.createCore(SolrCoreResourceManager.java:256) 
at com.datastax.bdp.search.solr.handler.admin.CassandraCoreAdminHandler.handleCreateAction(CassandraCoreAdminHandler.java:117)
...
Caused by: org.apache.solr.common.SolrException: Error loading class 'com.boogle.search.CustomQParserPlugin' 
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:474) 
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:405) 
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:541) 
...
Caused by: java.lang.ClassNotFoundException: com.boogle.search.CustomQParserPlugin 
at java.net.URLClassLoader$1.run(Unknown Source) 
at java.net.URLClassLoader$1.run(Unknown Source) 
...

Workaround

Using the class in this example with the JAR filename com.boogle.search.CustomQParserPlugin-1.0.jar, follow these steps to get the custom plugin working on all DSE Search nodes.
  1. Define the parser in the solrconfig.xml file:
    <queryParser name="myCustomQP" class="com.boogle.search.CustomQParserPlugin"/>
  2. Place custom code or Solr contrib modules in the Solr library directories
  3. Deploy the JAR file on all DSE Search nodes in the cluster in the appropriate lib/ directory.

    For example, package installations: /usr/share/dse/solr/lib/com.boogle.search.CustomQParserPlugin-1.0.jar

  4. Reload the Solr core with the new configuration.