Created
April 11, 2011 15:53
-
-
Save shellac/913746 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[] ja:loadClass "example.InitLarq" . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment