public class StandardSearchEngine extends Object implements SearchEngine
| Modifier and Type | Field and Description |
|---|---|
protected DocumentDAO |
documentDao |
protected static org.slf4j.Logger |
log |
protected org.apache.solr.client.solrj.embedded.EmbeddedSolrServer |
server |
| Modifier | Constructor and Description |
|---|---|
protected |
StandardSearchEngine() |
| Modifier and Type | Method and Description |
|---|---|
void |
addHit(Document document,
InputStream content)
Adds a new hit to the index
|
void |
addHit(Document document,
String content)
Adds a new Hit into the index
|
String |
check()
Launch the check on the Index
|
void |
close()
Close all indexing operations, shuts down the engine.
|
void |
deleteHit(long id)
Deletes an hit in the index of the search engine.
|
void |
deleteHits(Collection<Long> ids)
Removed all passed hits from the index
|
void |
dropIndexes()
Drops the fulltext index
|
long |
getCount()
Returns the number of indexed documents in all indexes.
|
Hit |
getHit(long id) |
Object |
getServer()
Service method to get access from the internal core
|
void |
init()
To be called on the context startup, this method creates all indexes and
unlock the existing ones
|
boolean |
isLocked()
Check if at least one index is locked
|
void |
optimize()
Launch the index optimization and triggers the build of spellcheck
dictionary
|
protected org.apache.solr.client.solrj.SolrQuery |
prepareSearchQuery(String expression,
String[] filters,
String expressionLanguage,
Integer rows)
Prepares the query for a search.
|
Hits |
search(String expression,
String[] filters,
String expressionLanguage,
Integer rows)
Search for hits.
|
void |
setConfig(ContextProperties config) |
void |
setDocumentDao(DocumentDAO documentDao) |
void |
unlock()
This method can unlock a locked index.
|
protected static org.slf4j.Logger log
protected DocumentDAO documentDao
protected org.apache.solr.client.solrj.embedded.EmbeddedSolrServer server
public void setConfig(ContextProperties config)
public void setDocumentDao(DocumentDAO documentDao)
public void addHit(Document document, String content) throws Exception
SearchEngineaddHit in interface SearchEngineExceptionpublic void addHit(Document document, InputStream content) throws Exception
SearchEngineaddHit in interface SearchEnginedocument - The document that we want to addcontent - Stream of the document's fileExceptionpublic void optimize()
SearchEngineoptimize in interface SearchEnginepublic String check()
SearchEnginecheck in interface SearchEnginepublic void deleteHit(long id)
SearchEnginedeleteHit in interface SearchEngineid - - id of the hitpublic void deleteHits(Collection<Long> ids)
SearchEnginedeleteHits in interface SearchEngineids - Collection of hit identifierspublic Hit getHit(long id)
getHit in interface SearchEnginepublic Hits search(String expression, String[] filters, String expressionLanguage, Integer rows)
SearchEnginesearch in interface SearchEngineprotected org.apache.solr.client.solrj.SolrQuery prepareSearchQuery(String expression, String[] filters, String expressionLanguage, Integer rows)
public void close()
SearchEngineclose in interface SearchEnginepublic void unlock()
SearchEngineunlock in interface SearchEnginepublic boolean isLocked()
SearchEngineisLocked in interface SearchEnginepublic long getCount()
SearchEnginegetCount in interface SearchEngineSearchEngine.getCount()public void dropIndexes()
SearchEnginedropIndexes in interface SearchEngineSearchEngine.dropIndexes()public void init()
SearchEngineinit in interface SearchEngineSearchEngine.init()public Object getServer()
SearchEnginegetServer in interface SearchEngineCopyright © 2008-2014 Logical Objects. All Rights Reserved.