public class LuceneIndex extends ServiceBase implements Indexer, Service, Shutdown
An entity is any resource in the graph that has one or more explicit types.
There are three types of index fields supported:
Configuration parameters are:
| Modifier and Type | Field and Description |
|---|---|
protected int |
batchDepth |
protected static Timer |
cleanupTimer |
static String |
COMMIT_PARAM |
protected boolean |
commitScheduled |
protected int |
commitWindow |
static String |
CONFIG_PARAM |
protected static int |
DEFAULT_COMMIT_WINDOW |
static String |
FIELD_GRAPH |
static String |
FIELD_LABEL |
static String |
FIELD_URI |
protected Set<com.hp.hpl.jena.rdf.model.Resource> |
ignoreProps |
protected boolean |
indexAll |
protected org.apache.lucene.store.Directory |
indexDir |
protected Set<com.hp.hpl.jena.rdf.model.Resource> |
labelOnlyProps |
protected Set<com.hp.hpl.jena.rdf.model.Resource> |
labelProps |
static String |
LOCATION_PARAM |
protected static org.apache.lucene.search.SearcherManager |
searchManager |
protected Set<com.hp.hpl.jena.rdf.model.Resource> |
valueProps |
protected static org.apache.lucene.index.IndexWriter |
writer |
config| Constructor and Description |
|---|
LuceneIndex() |
| Modifier and Type | Method and Description |
|---|---|
void |
addGraph(String graphname,
com.hp.hpl.jena.rdf.model.Model graph) |
void |
deleteGraph(String graphname) |
protected void |
doCommit() |
void |
endBatch()
Since the end up an update batch.
|
protected org.apache.lucene.index.IndexWriter |
getIndexWriter() |
protected void |
indexGraph(String graphname,
com.hp.hpl.jena.rdf.model.Model graph,
boolean update) |
void |
init(Map<String,String> config,
javax.servlet.ServletContext context) |
protected void |
requestCommit() |
protected void |
scheduleCommit() |
LuceneResult[] |
search(org.apache.lucene.search.Query query,
int offset,
int maxResults)
Search the index for entities which match a lucene query.
|
LuceneResult[] |
search(String query,
int offset,
int maxResults)
Search the index for entities which match a lucene query using the standard lucene
synta.
|
void |
shutdown() |
void |
startBatch()
Signal an indexer that a batch of changes is starting, this may be
used to optimize commit cycles.
|
void |
updateGraph(String graphname,
com.hp.hpl.jena.rdf.model.Model graph) |
getFileParam, getNamedService, getRequiredFileParam, getRequiredIntParam, getRequiredParam, postInit, postPostInitclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpostInit, postPostInitpublic static final String LOCATION_PARAM
public static final String CONFIG_PARAM
public static final String COMMIT_PARAM
public static final String FIELD_URI
public static final String FIELD_GRAPH
public static final String FIELD_LABEL
protected static int DEFAULT_COMMIT_WINDOW
protected boolean indexAll
protected Set<com.hp.hpl.jena.rdf.model.Resource> labelProps
protected Set<com.hp.hpl.jena.rdf.model.Resource> labelOnlyProps
protected Set<com.hp.hpl.jena.rdf.model.Resource> ignoreProps
protected Set<com.hp.hpl.jena.rdf.model.Resource> valueProps
protected org.apache.lucene.store.Directory indexDir
protected static org.apache.lucene.index.IndexWriter writer
protected static org.apache.lucene.search.SearcherManager searchManager
protected int batchDepth
protected int commitWindow
protected boolean commitScheduled
protected static Timer cleanupTimer
public void init(Map<String,String> config, javax.servlet.ServletContext context)
init in interface Serviceinit in class ServiceBasepublic void addGraph(String graphname, com.hp.hpl.jena.rdf.model.Model graph)
public void updateGraph(String graphname, com.hp.hpl.jena.rdf.model.Model graph)
updateGraph in interface Indexerpublic void deleteGraph(String graphname)
deleteGraph in interface Indexerpublic LuceneResult[] search(org.apache.lucene.search.Query query, int offset, int maxResults)
public LuceneResult[] search(String query, int offset, int maxResults)
protected void indexGraph(String graphname, com.hp.hpl.jena.rdf.model.Model graph, boolean update)
protected org.apache.lucene.index.IndexWriter getIndexWriter()
public void startBatch()
IndexerstartBatch in interface Indexerpublic void endBatch()
Indexerprotected void requestCommit()
throws IOException
IOExceptionprotected void scheduleCommit()
protected void doCommit()
Copyright © 2014. All rights reserved.