Package com.logicaldoc.core.searchengine
Class StandardSearchEngine
java.lang.Object
com.logicaldoc.core.searchengine.StandardSearchEngine
- All Implemented Interfaces:
- SearchEngine
Standard implementation that implements a local search engine
- Since:
- 6.5
- Author:
- Marco Meschieri - LogicalDOC
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddHit(Document document, InputStream content) Adds a new hit to the indexvoidAdds a new Hit into the indexcheck()Launch the check on the Indexvoidclose()Closes all indexing operations, shuts down the engine.voiddeleteHit(long id) Deletes an hit in the index of the search engine.voiddeleteHits(Collection<Long> ids) Removed all passed hits from the indexvoidDrops the full-text indexlonggetCount()Returns the number of indexed documents in all indexes.getHit(long id) Service method to get access from the internal corevoidinit()To be called on the context startup, this method creates all indexes and unlock the existing onesbooleanisLocked()Check if at least one index is lockedvoidoptimize()Launch the index optimization that physically deletes the removed entries.longpurge()Removes from the index those entries without a coutnerpart in the databaseExecutes a low-level query in the fulltext index
 Attention: The hits will be populated with just the fields stored in the indexSearch for hits.
 Attention: The hits will be populated with just the fields stored in the indexvoidsetConfig(ContextProperties config) voidsetDocumentDao(DocumentDAO documentDao) voidsetNoteDao(DocumentNoteDAO noteDao) voidunlock()This method can unlock a locked index.
- 
Field Details- 
VERSIONpublic static final org.apache.lucene.util.Version VERSION
 
- 
- 
Method Details- 
setConfig
- 
setDocumentDao
- 
addHitDescription copied from interface:SearchEngineAdds a new Hit into the index- Specified by:
- addHitin interface- SearchEngine
- Parameters:
- document- The document to add into the index
- content- The extracted body text
- Throws:
- IndexException- is an error happens and the document cannot be added to the index
 
- 
addHitDescription copied from interface:SearchEngineAdds a new hit to the index- Specified by:
- addHitin interface- SearchEngine
- Parameters:
- document- The document that we want to add
- content- Stream of the document's file
- Throws:
- IndexException- is an error happens and the document cannot be added to the index
 
- 
optimizepublic void optimize()Description copied from interface:SearchEngineLaunch the index optimization that physically deletes the removed entries. This is a long running operation.- Specified by:
- optimizein interface- SearchEngine
 
- 
checkDescription copied from interface:SearchEngineLaunch the check on the Index- Specified by:
- checkin interface- SearchEngine
- Returns:
- the output of the check
 
- 
deleteHitpublic void deleteHit(long id) Description copied from interface:SearchEngineDeletes an hit in the index of the search engine.- Specified by:
- deleteHitin interface- SearchEngine
- Parameters:
- id- - id of the hit
 
- 
deleteHitsDescription copied from interface:SearchEngineRemoved all passed hits from the index- Specified by:
- deleteHitsin interface- SearchEngine
- Parameters:
- ids- Collection of hit identifiers
 
- 
getHit- Specified by:
- getHitin interface- SearchEngine
 
- 
queryDescription copied from interface:SearchEngineExecutes a low-level query in the fulltext index
 Attention: The hits will be populated with just the fields stored in the index- Specified by:
- queryin interface- SearchEngine
- Parameters:
- expression- the query to use
- page- the page to retrieve
- size- the maximum number of entries to retrieve
- Returns:
- the search result, ordered by ascending id
 
- 
searchDescription copied from interface:SearchEngineSearch for hits.
 Attention: The hits will be populated with just the fields stored in the index- Specified by:
- searchin interface- SearchEngine
- Parameters:
- expression- the search expression
- filters- a set of filter expressions, optional
- expressionLanguage- the language in which the- expressionis writted
- rows- maximum number elements to be returned
- Returns:
- the hits ordered by descending score
 
- 
unlockpublic void unlock()Description copied from interface:SearchEngineThis method can unlock a locked index.- Specified by:
- unlockin interface- SearchEngine
 
- 
isLockedpublic boolean isLocked()Description copied from interface:SearchEngineCheck if at least one index is locked- Specified by:
- isLockedin interface- SearchEngine
- Returns:
- true if one or more indexes are locked
 
- 
getCountpublic long getCount()Description copied from interface:SearchEngineReturns the number of indexed documents in all indexes. Used for statistical output.- Specified by:
- getCountin interface- SearchEngine
- Returns:
- the total number of entries in the index
- See Also:
 
- 
purgepublic long purge()Description copied from interface:SearchEngineRemoves from the index those entries without a coutnerpart in the database- Specified by:
- purgein interface- SearchEngine
- Returns:
- number of deleted entries
 
- 
dropIndexpublic void dropIndex()Description copied from interface:SearchEngineDrops the full-text index- Specified by:
- dropIndexin interface- SearchEngine
- See Also:
 
- 
close@PreDestroy public void close()Description copied from interface:SearchEngineCloses all indexing operations, shuts down the engine.- Specified by:
- closein interface- SearchEngine
 
- 
init@PostConstruct public void init()Description copied from interface:SearchEngineTo be called on the context startup, this method creates all indexes and unlock the existing ones- Specified by:
- initin interface- SearchEngine
 
- 
getServerDescription copied from interface:SearchEngineService method to get access from the internal core- Specified by:
- getServerin interface- SearchEngine
- Returns:
- the search server representation
 
- 
setNoteDao
 
-