public class Solr extends Service implements DocumentListener
Modifier and Type | Field and Description |
---|---|
boolean |
commitOnFlush |
static org.slf4j.Logger |
log |
java.lang.String |
solrUrl |
cfgDir, dnaPool, MESSAGE_RECORDING_FORMAT_BINARY, MESSAGE_RECORDING_FORMAT_XML
Constructor and Description |
---|
Solr(java.lang.String n) |
Modifier and Type | Method and Description |
---|---|
void |
addDocument(org.apache.solr.common.SolrInputDocument doc) |
void |
addDocuments(java.util.Collection<org.apache.solr.common.SolrInputDocument> docs)
Add a solr document to the index
|
void |
commit()
Commit the solr index and make documents that have been submitted become
searchable.
|
void |
deleteDocument(java.lang.String docId) |
static ServiceType |
getMetaData()
This static method returns all the details of the class without it having
to be constructed.
|
java.lang.String |
getSolrUrl() |
boolean |
isCommitOnFlush() |
static void |
main(java.lang.String[] args) |
ProcessingStatus |
onDocument(Document doc) |
ProcessingStatus |
onDocuments(java.util.List<Document> docs) |
boolean |
onFlush() |
void |
optimize()
Optimize the index, if the index gets very fragmented, this helps optimize
performance and helps reclaim some disk space.
|
org.apache.solr.client.solrj.response.QueryResponse |
publishResults(org.apache.solr.client.solrj.response.QueryResponse resp) |
org.apache.solr.client.solrj.response.QueryResponse |
search(org.apache.solr.client.solrj.SolrQuery query)
Pass in custom solr query parameters and execute that query.
|
org.apache.solr.client.solrj.response.QueryResponse |
search(java.lang.String queryString) |
org.apache.solr.client.solrj.response.QueryResponse |
search(java.lang.String queryString,
int rows,
int start) |
void |
setCommitOnFlush(boolean commitOnFlush) |
void |
setSolrUrl(java.lang.String solrUrl) |
void |
startService() |
addListener, addListener, addTask, addTask, addTask, addTaskOneShot, allowDisplay, allowDisplay, attach, attach, broadcastState, buildDna, buildDna, buildDnaKeys, buildDnaNames, clearLastError, close, containsTask, copyShallowFrom, createPeer, createPeer, createRootReserved, detach, detach, detach, echoHeartbeat, error, error, error, getAttached, getCfgDir, getComm, getDeclaredMethodNames, getDeclaredMethods, getDescription, getDna, getDnaString, getHostName, getInbox, getInstanceId, getIntanceName, getInterfaceSet, getLastError, getMessageSet, getMetaData, getMethodMap, getMethodNames, getMethods, getMethodToolTip, getMsg, getName, getNotifyList, getNotifyListKeySet, getOutbox, getPeerKey, getPeerName, getServiceResourceFile, getSimpleName, getTasks, getThisThread, getType, hasError, hasPeers, help, help, in, info, info, invoke, invoke, invoke, invokeOn, isAttached, isAttached, isLocal, isReady, isRunning, isRuntime, isVirtual, load, load, logTimeEnable, mergeDna, mergeDna, mergePeerDna, movePeerDna, out, out, preProcessHook, preRoutingHook, publishError, publishQueueStats, publishState, publishStats, publishStatus, purgeTask, purgeTasks, releasePeers, releaseService, removeAllListeners, removeListener, requiresSecurity, reserve, reserve, reserveRoot, reserveRoot, reserveRootAs, run, save, save, save, send, send, send, send, sendBlocking, sendBlocking, sendBlocking, sendBlocking, sendPeer, setInstanceId, setName, setPeer, setSecurityProvider, setState, setThisThread, setVirtual, sleep, stackToString, startHeartbeat, startPeer, startPeer, startRecording, stopHeartbeat, stopMsgRecording, stopService, subscribe, subscribe, subscribe, toString, unsubscribe, unsubscribe, unsubscribe, updateStats, warn, warn
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName
public static final org.slf4j.Logger log
public java.lang.String solrUrl
public boolean commitOnFlush
public static void main(java.lang.String[] args)
public void addDocument(org.apache.solr.common.SolrInputDocument doc)
public void addDocuments(java.util.Collection<org.apache.solr.common.SolrInputDocument> docs)
docs
- a collection of solr input docs to add to solr.public void commit()
public void deleteDocument(java.lang.String docId)
public java.lang.String getSolrUrl()
public void optimize()
public org.apache.solr.client.solrj.response.QueryResponse search(org.apache.solr.client.solrj.SolrQuery query)
query
- the query to executepublic org.apache.solr.client.solrj.response.QueryResponse search(java.lang.String queryString)
public org.apache.solr.client.solrj.response.QueryResponse search(java.lang.String queryString, int rows, int start)
public org.apache.solr.client.solrj.response.QueryResponse publishResults(org.apache.solr.client.solrj.response.QueryResponse resp)
public void setSolrUrl(java.lang.String solrUrl)
public void startService()
startService
in interface ServiceInterface
startService
in class Service
public ProcessingStatus onDocuments(java.util.List<Document> docs)
onDocuments
in interface DocumentListener
public ProcessingStatus onDocument(Document doc)
onDocument
in interface DocumentListener
public boolean onFlush()
onFlush
in interface DocumentListener
public boolean isCommitOnFlush()
public void setCommitOnFlush(boolean commitOnFlush)
public static ServiceType getMetaData()