Skip to content

Instantly share code, notes, and snippets.

@shellac
Created April 11, 2011 15:53
Show Gist options
  • Save shellac/913746 to your computer and use it in GitHub Desktop.
Save shellac/913746 to your computer and use it in GitHub Desktop.
package example;
import com.hp.hpl.jena.query.larq.IndexLARQ;
import com.hp.hpl.jena.query.larq.LARQ;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.store.FSDirectory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class InitLarq {
final static Logger log = LoggerFactory.getLogger(InitLarq.class);
static {
String loc = "/path/to/lucene/dir";
IndexReader reader = IndexReader.open(FSDirectory.getDirectory(loc));
LARQ.setDefaultIndex(new IndexLARQ(reader));
log.info("Lucene LARQ index set to <{}>", loc);
}
}
[] ja:loadClass "example.InitLarq" .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment