Skip to content

Instantly share code, notes, and snippets.

@thelabdude
thelabdude / solr_alluxio.md
Last active September 21, 2017 15:09
Notes for running Solr on Alluxio

Here are some tips on getting started with using Alluxio as the filesystem for Solr indexes. I've tested with Alluxio 1.5.0 and Solr 6.6.0, but these instructions should work for other versions.

SOLR_TIP=<root directory where Solr is installed on your server>
ALLUXIO_HOME=<root directory where Alluxio is installed on your server>

Create an alluxio config directory to load into Solr's ZK with the following settings in solrconfig.xml:

   <directoryFactory name="DirectoryFactory"
[
{
"id":"1",
"feed":"parent",
"childDocuments":[
{
"id":"1-1",
"feed":"child"
},
{
var skipDoc = false; var pv = doc.getFirstField(\"id\"); var id = (pv != null) ? pv.value : null; logger.info(\"===> \" + id); pv = doc.getFirstField(\"robots\"); var robots = (pv != null) ? pv.value : null; if (robots != null && robots.indexOf(\"NOINDEX\") != -1) skipDoc = true;if (id == \"ERROR\") throw \"This document had an error (from script)\";doc.addField(\"testing\",\"1234\");doc.removeField(\"ignore_me\");!skipDoc;