Class AbstractLuceneIndexerAndSearcherFactory
- java.lang.Object
-
- org.alfresco.repo.search.impl.lucene.AbstractIndexerAndSearcher
-
- org.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerAndSearcherFactory
-
- All Implemented Interfaces:
javax.transaction.xa.XAResource,LuceneConfig,LuceneIndexerAndSearcher,IndexerAndSearcher,org.springframework.beans.factory.Aware,org.springframework.beans.factory.DisposableBean,org.springframework.context.ApplicationContextAware
public abstract class AbstractLuceneIndexerAndSearcherFactory extends AbstractIndexerAndSearcher implements LuceneIndexerAndSearcher, javax.transaction.xa.XAResource, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.DisposableBean
This class is resource manager LuceneIndexers and LuceneSearchers. It supports two phase commit inside XA transactions and outside transactions it provides thread local transaction support. TODO: Provide pluggable support for a transaction manager TODO: Integrate with Spring transactions- Author:
- andyh
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractLuceneIndexerAndSearcherFactory.LuceneIndexBackupComponentThis component is able to safely perform backups of the Lucene indexes while the server is running.static classAbstractLuceneIndexerAndSearcherFactory.LuceneIndexBackupJobJob that lock uses theAbstractLuceneIndexerAndSearcherFactory.LuceneIndexBackupComponentto perform safe backups of the Lucene indexes.-
Nested classes/interfaces inherited from interface org.alfresco.repo.search.impl.lucene.LuceneIndexerAndSearcher
LuceneIndexerAndSearcher.ReadOnlyWork<Result>
-
-
Field Summary
Fields Modifier and Type Field Description protected org.alfresco.repo.tenant.TenantServicetenantService
-
Constructor Summary
Constructors Constructor Description AbstractLuceneIndexerAndSearcherFactory()Private constructor for the singleton TODO: FIt in with IOC
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcommit()Commit the transactionvoidcommit(javax.transaction.xa.Xid xid, boolean onePhase)protected abstract LuceneIndexercreateIndexer(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String deltaId)Encapsulate creating an indexerstatic voiddeleteDirectory(java.io.File directory)voiddestroy()<R> RdoReadOnly(LuceneIndexerAndSearcher.ReadOnlyWork<R> lockWork)voidend(javax.transaction.xa.Xid xid, int flag)voidflush()Do any indexing that may be pending on behalf of the current transaction.voidforget(javax.transaction.xa.Xid xid)protected abstract java.util.List<org.alfresco.service.cmr.repository.StoreRef>getAllStores()org.springframework.context.ConfigurableApplicationContextgetApplicationContext()Gets the application context through which events can be broadcastNodeBulkLoadergetBulkLoader()Get preloader - may be null if preloading is not supportedlonggetCommitLockTimeout()Get the commit lock timout.org.alfresco.repo.search.MLAnalysisModegetDefaultMLIndexAnalysisMode()The default mode for analysing ML text during index.org.alfresco.repo.search.MLAnalysisModegetDefaultMLSearchAnalysisMode()The default mode for analysis of ML text during search.booleangetFairLocking()Should we use a 'fair' locking policy, giving queue-like access behaviour to the indexes and avoiding starvation? Default isfalsesince fair locking appears to cause deadlock on old JVMs.LuceneIndexergetIndexer(org.alfresco.service.cmr.repository.StoreRef storeRef)Get an indexer for the store to use in the current transaction for this thread of control.intgetIndexerBatchSize()The batch size in which to group flushes of the index.intgetIndexerMaxFieldLength()Get the max number of tokens in the fieldjava.lang.StringgetIndexRootLocation()The path to the index locationjava.lang.StringgetLockDirectory()Get the directory where any lock files are written (by default there are none)intgetMaxDocIdCacheSize()How many document ids to cache (-ve => unbounded)intgetMaxDocsForInMemoryIndex()Max docs to allow for in memory indexes (does no apply to merges)intgetMaxDocsForInMemoryMerge()Max doc number that will merged in memory (and not on disk)intgetMaxDocumentCacheSize()How many documents to cache (-ve => unbounded)intgetMaxIsCategoryCacheSize()How many categories to cache (-ve => unbounded)intgetMaxLinkAspectCacheSize()How many link aspects to cache (-ve => unbounded)intgetMaxParentCacheSize()How many parents to cache (-ve => unbounded)intgetMaxPathCacheSize()How many paths to cache (-ve => unbounded)doublegetMaxRamInMbForInMemoryIndex()Max Ram to allow for in memory indexes (does not apply to merges)doublegetMaxRamInMbForInMemoryMerge()Ram based limit for in memory mergesintgetMaxRawResultSetSizeForInMemorySort()longgetMaxTransformationTime()Get the max time for an atomic transformintgetMaxTypeCacheSize()How many types to cache (-ve => unbounded)intgetMergerMaxBufferedDocs()Lucene merger configintgetMergerMaxMergeDocs()Lucene merger configintgetMergerMergeFactor()Lucene merger configdoublegetMergerRamBufferSizeMb()Ram based limit for in memory portion of merger index.intgetMergerTargetIndexCount()Target index count.intgetMergerTargetOverlayCount()Target overlays (will apply deletions and create indexes if over this limit)intgetMergerTargetOverlaysBlockingFactor()The factor by which the target overlay count is multiplied to determine the allowable number of overlays before blocking.protected abstract org.alfresco.service.cmr.search.SearchServicegetNodeSearcher()Get node-based searcher (for "selectNodes / selectProperties")booleangetPostSortDateTime()If we are using the DateAnalyser then lucene sort is only to the date, as that is all that is in the index.protected LuceneQueryLanguageSPIgetQueryLanguage(java.lang.String name)intgetQueryMaxClauses()The maximum numbr of sub-queries the can be generated out of wild card expansion etcQueryRegisterComponentgetQueryRegister()Get the query register.LuceneSearchergetSearcher(org.alfresco.service.cmr.repository.StoreRef storeRef, boolean searchDelta)Encapsulate creating a searcher over the main indexprotected abstract LuceneSearchergetSearcher(org.alfresco.service.cmr.repository.StoreRef storeRef, LuceneIndexer indexer)Get a searcher over the index and the current deltaintgetTermIndexInterval()Lucene term index intervaljava.util.concurrent.ThreadPoolExecutorgetThreadPoolExecutor()Get the thread pool for index merging etcintgetTransactionTimeout()booleangetUseInMemorySort()booleangetUseNioMemoryMapping()Use the nio memory mapping (work arounf for bugs with some JVMs)longgetWriteLockTimeout()Get the write lock timeoutintgetWriterMaxBufferedDocs()Lucene writer configintgetWriterMaxMergeDocs()Lucene writer configintgetWriterMergeFactor()Lucene writer configdoublegetWriterRamBufferSizeMb()Ram based limit for in memory portion of writer index.booleanisCacheEnabled()Is caching enabled for each index fragment?booleanisContentIndexingEnabled()booleanisSameRM(javax.transaction.xa.XAResource xar)static voidmain(java.lang.String[] args)intprepare()Prepare the transaction TODO: Store prepare resultsintprepare(javax.transaction.xa.Xid xid)javax.transaction.xa.Xid[]recover(int arg0)voidrollback()Roll back the transactionvoidrollback(javax.transaction.xa.Xid xid)voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)voidsetBulkLoader(NodeBulkLoader bulkLoader)voidsetCacheEnabled(boolean cacheEnabled)voidsetCommitLockTimeout(long timeout)Set the lucene commit lock timeout (no longer used with lucene 2.1)voidsetContentIndexingEnabled(boolean contentIndexingEnabled)Enable/Disable the indexing of content Content is not indexed and FTS disabled When disabled, documents are marked as requiring FTS indexing.voidsetDefaultMLIndexAnalysisMode(org.alfresco.repo.search.MLAnalysisMode mode)Set the ML analysis mode at index time.voidsetDefaultMLSearchAnalysisMode(org.alfresco.repo.search.MLAnalysisMode mode)Set the ML analysis mode at search timevoidsetFairLocking(boolean fairLocking)voidsetIndexerBatchSize(int indexerBatchSize)Set the batch six to use for background indexingvoidsetIndexerMaxFieldLength(int indexerMaxFieldLength)Set the max field length.voidsetIndexRootLocation(java.lang.String indexRootLocation)Set the directory that contains the indexesvoidsetLockDirectory(java.lang.String lockDirectory)Set the lock dir - just to make sure - this should no longer be used.voidsetLockPollInterval(long time)Set the lock poll interval in msvoidsetMaxAtomicTransformationTime(long maxAtomicTransformationTime)Set the maximum average transformation time allowed to a transformer in order to have the transformation performed in the current transaction.voidsetMaxDocIdCacheSize(int maxDocIdCacheSize)voidsetMaxDocsForInMemoryIndex(int maxDocsForInMemoryIndex)voidsetMaxDocsForInMemoryMerge(int maxDocsForInMemoryMerge)voidsetMaxDocumentCacheSize(int maxDocumentCacheSize)voidsetMaxIsCategoryCacheSize(int maxIsCategoryCacheSize)voidsetMaxLinkAspectCacheSize(int maxLinkAspectCacheSize)voidsetMaxParentCacheSize(int maxParentCacheSize)voidsetMaxPathCacheSize(int maxPathCacheSize)voidsetMaxRamInMbForInMemoryIndex(double maxRamInMbForInMemoryIndex)voidsetMaxRamInMbForInMemoryMerge(double maxRamInMbForInMemoryMerge)voidsetMaxRawResultSetSizeForInMemorySort(int maxRawResultSetSizeForInMemorySort)voidsetMaxTypeCacheSize(int maxTypeCacheSize)voidsetMergerMaxBufferedDocs(int mergerMaxBufferedDocs)voidsetMergerMaxMergeDocs(int mergerMaxMergeDocs)voidsetMergerMergeFactor(int mergerMergeFactor)voidsetMergerRamBufferSizeMb(double mergerRamBufferSizeMb)voidsetMergerTargetIndexCount(int mergerTargetIndexCount)voidsetMergerTargetOverlayCount(int mergerTargetOverlayCount)voidsetMergerTargetOverlaysBlockingFactor(int mergerTargetOverlaysBlockingFactor)voidsetPostSortDateTime(boolean postSortDateTime)voidsetQueryMaxClauses(int queryMaxClauses)Set the max number of queries in a llucen boolean queryvoidsetQueryRegister(QueryRegisterComponent queryRegister)Set the query registervoidsetTenantService(org.alfresco.repo.tenant.TenantService tenantService)Set the tenant servicevoidsetTermIndexInterval(int termIndexInterval)voidsetThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor threadPoolExecutor)booleansetTransactionTimeout(int timeout)voidsetUseInMemorySort(boolean useInMemorySort)voidsetUseNioMemoryMapping(boolean useNioMemoryMapping)voidsetWriteLockTimeout(long timeout)Set the lucene write lock timeoutvoidsetWriterMaxBufferedDocs(int writerMaxBufferedDocs)voidsetWriterMaxMergeDocs(int writerMaxMergeDocs)voidsetWriterMergeFactor(int writerMergeFactor)voidsetWriterRamBufferSizeMb(double writerRamBufferSizeMb)voidstart(javax.transaction.xa.Xid xid, int flag)-
Methods inherited from class org.alfresco.repo.search.impl.lucene.AbstractIndexerAndSearcher
getQueryLanguages, registerQueryLanguage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.alfresco.repo.search.IndexerAndSearcher
getQueryLanguages, registerQueryLanguage
-
-
-
-
Method Detail
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
getApplicationContext
public org.springframework.context.ConfigurableApplicationContext getApplicationContext()
Description copied from interface:LuceneConfigGets the application context through which events can be broadcast- Specified by:
getApplicationContextin interfaceLuceneConfig- Returns:
- ConfigurableApplicationContext
-
setIndexRootLocation
public void setIndexRootLocation(java.lang.String indexRootLocation)
Set the directory that contains the indexes- Parameters:
indexRootLocation- String
-
setTenantService
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
Set the tenant service- Parameters:
tenantService- TenantService
-
setQueryRegister
public void setQueryRegister(QueryRegisterComponent queryRegister)
Set the query register- Parameters:
queryRegister- QueryRegisterComponent
-
getQueryRegister
public QueryRegisterComponent getQueryRegister()
Get the query register.- Returns:
- - the query register.
-
setMaxAtomicTransformationTime
public void setMaxAtomicTransformationTime(long maxAtomicTransformationTime)
Set the maximum average transformation time allowed to a transformer in order to have the transformation performed in the current transaction. The default is 20ms.- Specified by:
setMaxAtomicTransformationTimein interfaceLuceneConfig- Parameters:
maxAtomicTransformationTime- the maximum average time that a text transformation may take in order to be performed atomically.
-
getMaxTransformationTime
public long getMaxTransformationTime()
Get the max time for an atomic transform- Specified by:
getMaxTransformationTimein interfaceLuceneConfig- Returns:
- - milliseconds as a long
-
getBulkLoader
public NodeBulkLoader getBulkLoader()
Description copied from interface:LuceneConfigGet preloader - may be null if preloading is not supported- Specified by:
getBulkLoaderin interfaceLuceneConfig
-
setBulkLoader
public void setBulkLoader(NodeBulkLoader bulkLoader)
-
getIndexer
public LuceneIndexer getIndexer(org.alfresco.service.cmr.repository.StoreRef storeRef) throws IndexerException
Get an indexer for the store to use in the current transaction for this thread of control.- Specified by:
getIndexerin interfaceIndexerAndSearcher- Parameters:
storeRef- - the id of the store- Returns:
- Indexer
- Throws:
IndexerException
-
createIndexer
protected abstract LuceneIndexer createIndexer(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String deltaId)
Encapsulate creating an indexer- Parameters:
storeRef- StoreRefdeltaId- String- Returns:
- - the indexer made by the concrete implemntation
-
getSearcher
public LuceneSearcher getSearcher(org.alfresco.service.cmr.repository.StoreRef storeRef, boolean searchDelta) throws SearcherException
Encapsulate creating a searcher over the main index- Specified by:
getSearcherin interfaceIndexerAndSearcher- Parameters:
storeRef- StoreRefsearchDelta- - serach the in progress transaction as well as the main index (this is ignored for searches that do full text)- Returns:
- SearchService
- Throws:
SearcherException
-
getNodeSearcher
protected abstract org.alfresco.service.cmr.search.SearchService getNodeSearcher() throws SearcherExceptionGet node-based searcher (for "selectNodes / selectProperties")- Throws:
SearcherException
-
getSearcher
protected abstract LuceneSearcher getSearcher(org.alfresco.service.cmr.repository.StoreRef storeRef, LuceneIndexer indexer) throws SearcherException
Get a searcher over the index and the current delta- Parameters:
storeRef- StoreRefindexer- LuceneIndexer- Returns:
- - the searcher made by the concrete implementation.
- Throws:
SearcherException
-
commit
public void commit(javax.transaction.xa.Xid xid, boolean onePhase) throws javax.transaction.xa.XAException- Specified by:
commitin interfacejavax.transaction.xa.XAResource- Throws:
javax.transaction.xa.XAException
-
end
public void end(javax.transaction.xa.Xid xid, int flag) throws javax.transaction.xa.XAException- Specified by:
endin interfacejavax.transaction.xa.XAResource- Throws:
javax.transaction.xa.XAException
-
forget
public void forget(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException- Specified by:
forgetin interfacejavax.transaction.xa.XAResource- Throws:
javax.transaction.xa.XAException
-
getTransactionTimeout
public int getTransactionTimeout() throws javax.transaction.xa.XAException- Specified by:
getTransactionTimeoutin interfacejavax.transaction.xa.XAResource- Throws:
javax.transaction.xa.XAException
-
isSameRM
public boolean isSameRM(javax.transaction.xa.XAResource xar) throws javax.transaction.xa.XAException- Specified by:
isSameRMin interfacejavax.transaction.xa.XAResource- Throws:
javax.transaction.xa.XAException
-
prepare
public int prepare(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException- Specified by:
preparein interfacejavax.transaction.xa.XAResource- Throws:
javax.transaction.xa.XAException
-
recover
public javax.transaction.xa.Xid[] recover(int arg0) throws javax.transaction.xa.XAException- Specified by:
recoverin interfacejavax.transaction.xa.XAResource- Throws:
javax.transaction.xa.XAException
-
rollback
public void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException- Specified by:
rollbackin interfacejavax.transaction.xa.XAResource- Throws:
javax.transaction.xa.XAException
-
setTransactionTimeout
public boolean setTransactionTimeout(int timeout) throws javax.transaction.xa.XAException- Specified by:
setTransactionTimeoutin interfacejavax.transaction.xa.XAResource- Throws:
javax.transaction.xa.XAException
-
start
public void start(javax.transaction.xa.Xid xid, int flag) throws javax.transaction.xa.XAException- Specified by:
startin interfacejavax.transaction.xa.XAResource- Throws:
javax.transaction.xa.XAException
-
commit
public void commit() throws IndexerExceptionCommit the transaction- Specified by:
commitin interfaceLuceneIndexerAndSearcher- Throws:
IndexerException
-
prepare
public int prepare() throws IndexerExceptionPrepare the transaction TODO: Store prepare results- Specified by:
preparein interfaceLuceneIndexerAndSearcher- Returns:
- - the tx code
- Throws:
IndexerException
-
rollback
public void rollback()
Roll back the transaction- Specified by:
rollbackin interfaceLuceneIndexerAndSearcher
-
flush
public void flush()
Description copied from interface:IndexerAndSearcherDo any indexing that may be pending on behalf of the current transaction.- Specified by:
flushin interfaceIndexerAndSearcher
-
getIndexRootLocation
public java.lang.String getIndexRootLocation()
Description copied from interface:LuceneConfigThe path to the index location- Specified by:
getIndexRootLocationin interfaceLuceneConfig- Returns:
- String
-
getIndexerBatchSize
public int getIndexerBatchSize()
Description copied from interface:LuceneConfigThe batch size in which to group flushes of the index.- Specified by:
getIndexerBatchSizein interfaceLuceneConfig- Returns:
- int
-
setIndexerBatchSize
public void setIndexerBatchSize(int indexerBatchSize)
Set the batch six to use for background indexing- Specified by:
setIndexerBatchSizein interfaceLuceneConfig- Parameters:
indexerBatchSize- int
-
getLockDirectory
public java.lang.String getLockDirectory()
Get the directory where any lock files are written (by default there are none)- Returns:
- - the path to the directory
-
setLockDirectory
public void setLockDirectory(java.lang.String lockDirectory)
Description copied from interface:LuceneConfigSet the lock dir - just to make sure - this should no longer be used.- Specified by:
setLockDirectoryin interfaceLuceneConfig- Parameters:
lockDirectory- String
-
getQueryMaxClauses
public int getQueryMaxClauses()
Description copied from interface:LuceneConfigThe maximum numbr of sub-queries the can be generated out of wild card expansion etc- Specified by:
getQueryMaxClausesin interfaceLuceneConfig- Returns:
- int
-
setQueryMaxClauses
public void setQueryMaxClauses(int queryMaxClauses)
Set the max number of queries in a llucen boolean query- Specified by:
setQueryMaxClausesin interfaceLuceneConfig- Parameters:
queryMaxClauses- int
-
setWriteLockTimeout
public void setWriteLockTimeout(long timeout)
Set the lucene write lock timeout- Specified by:
setWriteLockTimeoutin interfaceLuceneConfig- Parameters:
timeout- long
-
setCommitLockTimeout
public void setCommitLockTimeout(long timeout)
Set the lucene commit lock timeout (no longer used with lucene 2.1)- Specified by:
setCommitLockTimeoutin interfaceLuceneConfig- Parameters:
timeout- long
-
getCommitLockTimeout
public long getCommitLockTimeout()
Get the commit lock timout.- Specified by:
getCommitLockTimeoutin interfaceLuceneConfig- Returns:
- - the timeout
-
getWriteLockTimeout
public long getWriteLockTimeout()
Get the write lock timeout- Specified by:
getWriteLockTimeoutin interfaceLuceneConfig- Returns:
- - the timeout in ms
-
setLockPollInterval
public void setLockPollInterval(long time)
Set the lock poll interval in ms- Specified by:
setLockPollIntervalin interfaceLuceneConfig- Parameters:
time- long
-
getIndexerMaxFieldLength
public int getIndexerMaxFieldLength()
Get the max number of tokens in the field- Specified by:
getIndexerMaxFieldLengthin interfaceLuceneConfig- Returns:
- - the max tokens considered.
-
setIndexerMaxFieldLength
public void setIndexerMaxFieldLength(int indexerMaxFieldLength)
Set the max field length.- Specified by:
setIndexerMaxFieldLengthin interfaceLuceneConfig- Parameters:
indexerMaxFieldLength- int
-
getThreadPoolExecutor
public java.util.concurrent.ThreadPoolExecutor getThreadPoolExecutor()
Description copied from interface:LuceneConfigGet the thread pool for index merging etc- Specified by:
getThreadPoolExecutorin interfaceLuceneConfig- Returns:
- ThreadPoolExecutor
-
setThreadPoolExecutor
public void setThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor threadPoolExecutor)
-
getUseInMemorySort
public boolean getUseInMemorySort()
- Specified by:
getUseInMemorySortin interfaceLuceneConfig- Returns:
- the useInMemorySort
-
setUseInMemorySort
public void setUseInMemorySort(boolean useInMemorySort)
- Parameters:
useInMemorySort- the useInMemorySort to set
-
getMaxRawResultSetSizeForInMemorySort
public int getMaxRawResultSetSizeForInMemorySort()
- Specified by:
getMaxRawResultSetSizeForInMemorySortin interfaceLuceneConfig- Returns:
- the maxRawResultSetSizeForInMemorySort
-
setMaxRawResultSetSizeForInMemorySort
public void setMaxRawResultSetSizeForInMemorySort(int maxRawResultSetSizeForInMemorySort)
- Parameters:
maxRawResultSetSizeForInMemorySort- the maxRawResultSetSizeForInMemorySort to set
-
getDefaultMLIndexAnalysisMode
public org.alfresco.repo.search.MLAnalysisMode getDefaultMLIndexAnalysisMode()
Description copied from interface:LuceneConfigThe default mode for analysing ML text during index.- Specified by:
getDefaultMLIndexAnalysisModein interfaceLuceneConfig- Returns:
- MLAnalysisMode
-
setDefaultMLIndexAnalysisMode
public void setDefaultMLIndexAnalysisMode(org.alfresco.repo.search.MLAnalysisMode mode)
Set the ML analysis mode at index time.- Specified by:
setDefaultMLIndexAnalysisModein interfaceLuceneConfig- Parameters:
mode- MLAnalysisMode
-
getDefaultMLSearchAnalysisMode
public org.alfresco.repo.search.MLAnalysisMode getDefaultMLSearchAnalysisMode()
Description copied from interface:LuceneConfigThe default mode for analysis of ML text during search.- Specified by:
getDefaultMLSearchAnalysisModein interfaceLuceneConfig- Returns:
- MLAnalysisMode
-
setDefaultMLSearchAnalysisMode
public void setDefaultMLSearchAnalysisMode(org.alfresco.repo.search.MLAnalysisMode mode)
Set the ML analysis mode at search time- Specified by:
setDefaultMLSearchAnalysisModein interfaceLuceneConfig- Parameters:
mode- MLAnalysisMode
-
getMaxDocIdCacheSize
public int getMaxDocIdCacheSize()
Description copied from interface:LuceneConfigHow many document ids to cache (-ve => unbounded)- Specified by:
getMaxDocIdCacheSizein interfaceLuceneConfig- Returns:
- int
-
setMaxDocIdCacheSize
public void setMaxDocIdCacheSize(int maxDocIdCacheSize)
- Specified by:
setMaxDocIdCacheSizein interfaceLuceneConfig- Parameters:
maxDocIdCacheSize- int
-
getMaxDocsForInMemoryMerge
public int getMaxDocsForInMemoryMerge()
Description copied from interface:LuceneConfigMax doc number that will merged in memory (and not on disk)- Specified by:
getMaxDocsForInMemoryMergein interfaceLuceneConfig- Returns:
- int
-
setMaxDocsForInMemoryMerge
public void setMaxDocsForInMemoryMerge(int maxDocsForInMemoryMerge)
- Specified by:
setMaxDocsForInMemoryMergein interfaceLuceneConfig- Parameters:
maxDocsForInMemoryMerge- int
-
getMaxDocumentCacheSize
public int getMaxDocumentCacheSize()
Description copied from interface:LuceneConfigHow many documents to cache (-ve => unbounded)- Specified by:
getMaxDocumentCacheSizein interfaceLuceneConfig- Returns:
- int
-
setMaxDocumentCacheSize
public void setMaxDocumentCacheSize(int maxDocumentCacheSize)
- Specified by:
setMaxDocumentCacheSizein interfaceLuceneConfig- Parameters:
maxDocumentCacheSize- int
-
getMaxIsCategoryCacheSize
public int getMaxIsCategoryCacheSize()
Description copied from interface:LuceneConfigHow many categories to cache (-ve => unbounded)- Specified by:
getMaxIsCategoryCacheSizein interfaceLuceneConfig- Returns:
- int
-
setMaxIsCategoryCacheSize
public void setMaxIsCategoryCacheSize(int maxIsCategoryCacheSize)
- Specified by:
setMaxIsCategoryCacheSizein interfaceLuceneConfig- Parameters:
maxIsCategoryCacheSize- int
-
getMaxLinkAspectCacheSize
public int getMaxLinkAspectCacheSize()
Description copied from interface:LuceneConfigHow many link aspects to cache (-ve => unbounded)- Specified by:
getMaxLinkAspectCacheSizein interfaceLuceneConfig- Returns:
- int
-
setMaxLinkAspectCacheSize
public void setMaxLinkAspectCacheSize(int maxLinkAspectCacheSize)
- Specified by:
setMaxLinkAspectCacheSizein interfaceLuceneConfig- Parameters:
maxLinkAspectCacheSize- int
-
getMaxParentCacheSize
public int getMaxParentCacheSize()
Description copied from interface:LuceneConfigHow many parents to cache (-ve => unbounded)- Specified by:
getMaxParentCacheSizein interfaceLuceneConfig- Returns:
- int
-
setMaxParentCacheSize
public void setMaxParentCacheSize(int maxParentCacheSize)
- Specified by:
setMaxParentCacheSizein interfaceLuceneConfig- Parameters:
maxParentCacheSize- int
-
getMaxPathCacheSize
public int getMaxPathCacheSize()
Description copied from interface:LuceneConfigHow many paths to cache (-ve => unbounded)- Specified by:
getMaxPathCacheSizein interfaceLuceneConfig- Returns:
- int
-
setMaxPathCacheSize
public void setMaxPathCacheSize(int maxPathCacheSize)
- Specified by:
setMaxPathCacheSizein interfaceLuceneConfig- Parameters:
maxPathCacheSize- int
-
getMaxTypeCacheSize
public int getMaxTypeCacheSize()
Description copied from interface:LuceneConfigHow many types to cache (-ve => unbounded)- Specified by:
getMaxTypeCacheSizein interfaceLuceneConfig- Returns:
- int
-
setMaxTypeCacheSize
public void setMaxTypeCacheSize(int maxTypeCacheSize)
- Specified by:
setMaxTypeCacheSizein interfaceLuceneConfig- Parameters:
maxTypeCacheSize- int
-
getMergerMaxMergeDocs
public int getMergerMaxMergeDocs()
Description copied from interface:LuceneConfigLucene merger config- Specified by:
getMergerMaxMergeDocsin interfaceLuceneConfig- Returns:
- int
-
setMergerMaxMergeDocs
public void setMergerMaxMergeDocs(int mergerMaxMergeDocs)
- Specified by:
setMergerMaxMergeDocsin interfaceLuceneConfig- Parameters:
mergerMaxMergeDocs- int
-
getMergerMergeFactor
public int getMergerMergeFactor()
Description copied from interface:LuceneConfigLucene merger config- Specified by:
getMergerMergeFactorin interfaceLuceneConfig- Returns:
- int
-
setMergerMergeFactor
public void setMergerMergeFactor(int mergerMergeFactor)
- Specified by:
setMergerMergeFactorin interfaceLuceneConfig- Parameters:
mergerMergeFactor- int
-
getMergerMaxBufferedDocs
public int getMergerMaxBufferedDocs()
Description copied from interface:LuceneConfigLucene merger config- Specified by:
getMergerMaxBufferedDocsin interfaceLuceneConfig- Returns:
- int
-
setMergerMaxBufferedDocs
public void setMergerMaxBufferedDocs(int mergerMaxBufferedDocs)
- Specified by:
setMergerMaxBufferedDocsin interfaceLuceneConfig- Parameters:
mergerMaxBufferedDocs- int
-
getMergerTargetIndexCount
public int getMergerTargetIndexCount()
Description copied from interface:LuceneConfigTarget index count. Over this indexes will be merged together.- Specified by:
getMergerTargetIndexCountin interfaceLuceneConfig- Returns:
- int
-
setMergerTargetIndexCount
public void setMergerTargetIndexCount(int mergerTargetIndexCount)
- Specified by:
setMergerTargetIndexCountin interfaceLuceneConfig- Parameters:
mergerTargetIndexCount- int
-
getMergerTargetOverlayCount
public int getMergerTargetOverlayCount()
Description copied from interface:LuceneConfigTarget overlays (will apply deletions and create indexes if over this limit)- Specified by:
getMergerTargetOverlayCountin interfaceLuceneConfig- Returns:
- int
-
setMergerTargetOverlayCount
public void setMergerTargetOverlayCount(int mergerTargetOverlayCount)
- Specified by:
setMergerTargetOverlayCountin interfaceLuceneConfig- Parameters:
mergerTargetOverlayCount- int
-
getMergerTargetOverlaysBlockingFactor
public int getMergerTargetOverlaysBlockingFactor()
Description copied from interface:LuceneConfigThe factor by which the target overlay count is multiplied to determine the allowable number of overlays before blocking.- Specified by:
getMergerTargetOverlaysBlockingFactorin interfaceLuceneConfig- Returns:
- the factor by which the target overlay count is multiplied to determine the allowable number of overlays before blocking
-
setMergerTargetOverlaysBlockingFactor
public void setMergerTargetOverlaysBlockingFactor(int mergerTargetOverlaysBlockingFactor)
- Specified by:
setMergerTargetOverlaysBlockingFactorin interfaceLuceneConfig- Parameters:
mergerTargetOverlaysBlockingFactor- int
-
getFairLocking
public boolean getFairLocking()
Description copied from interface:LuceneConfigShould we use a 'fair' locking policy, giving queue-like access behaviour to the indexes and avoiding starvation? Default isfalsesince fair locking appears to cause deadlock on old JVMs.- Specified by:
getFairLockingin interfaceLuceneConfig- Returns:
trueif a fair locking policy should be used
-
setFairLocking
public void setFairLocking(boolean fairLocking)
- Specified by:
setFairLockingin interfaceLuceneConfig- Parameters:
fairLocking- boolean
-
getTermIndexInterval
public int getTermIndexInterval()
Description copied from interface:LuceneConfigLucene term index interval- Specified by:
getTermIndexIntervalin interfaceLuceneConfig- Returns:
- int
-
setTermIndexInterval
public void setTermIndexInterval(int termIndexInterval)
- Specified by:
setTermIndexIntervalin interfaceLuceneConfig- Parameters:
termIndexInterval- int
-
getUseNioMemoryMapping
public boolean getUseNioMemoryMapping()
Description copied from interface:LuceneConfigUse the nio memory mapping (work arounf for bugs with some JVMs)- Specified by:
getUseNioMemoryMappingin interfaceLuceneConfig- Returns:
- boolean
-
setUseNioMemoryMapping
public void setUseNioMemoryMapping(boolean useNioMemoryMapping)
- Specified by:
setUseNioMemoryMappingin interfaceLuceneConfig- Parameters:
useNioMemoryMapping- boolean
-
getWriterMaxMergeDocs
public int getWriterMaxMergeDocs()
Description copied from interface:LuceneConfigLucene writer config- Specified by:
getWriterMaxMergeDocsin interfaceLuceneConfig- Returns:
- int
-
setWriterMaxMergeDocs
public void setWriterMaxMergeDocs(int writerMaxMergeDocs)
- Specified by:
setWriterMaxMergeDocsin interfaceLuceneConfig- Parameters:
writerMaxMergeDocs- int
-
getWriterMergeFactor
public int getWriterMergeFactor()
Description copied from interface:LuceneConfigLucene writer config- Specified by:
getWriterMergeFactorin interfaceLuceneConfig- Returns:
- int
-
setWriterMergeFactor
public void setWriterMergeFactor(int writerMergeFactor)
- Specified by:
setWriterMergeFactorin interfaceLuceneConfig- Parameters:
writerMergeFactor- int
-
getWriterMaxBufferedDocs
public int getWriterMaxBufferedDocs()
Description copied from interface:LuceneConfigLucene writer config- Specified by:
getWriterMaxBufferedDocsin interfaceLuceneConfig- Returns:
- int
-
setWriterMaxBufferedDocs
public void setWriterMaxBufferedDocs(int writerMaxBufferedDocs)
- Specified by:
setWriterMaxBufferedDocsin interfaceLuceneConfig- Parameters:
writerMaxBufferedDocs- int
-
isCacheEnabled
public boolean isCacheEnabled()
Description copied from interface:LuceneConfigIs caching enabled for each index fragment?- Specified by:
isCacheEnabledin interfaceLuceneConfig- Returns:
- boolean
-
setCacheEnabled
public void setCacheEnabled(boolean cacheEnabled)
- Specified by:
setCacheEnabledin interfaceLuceneConfig- Parameters:
cacheEnabled- boolean
-
getPostSortDateTime
public boolean getPostSortDateTime()
Description copied from interface:LuceneConfigIf we are using the DateAnalyser then lucene sort is only to the date, as that is all that is in the index. If this is true, a query that defines a sort on a datetime field will do a post sort in Java. For the DateTimeAnalyser no post sort is done. (The default config does do a post sort) In the future, this behaviour may also be set per query on the SearchParameters object.- Specified by:
getPostSortDateTimein interfaceLuceneConfig- Returns:
- boolean
-
setPostSortDateTime
public void setPostSortDateTime(boolean postSortDateTime)
- Specified by:
setPostSortDateTimein interfaceLuceneConfig- Parameters:
postSortDateTime- boolean
-
getMaxDocsForInMemoryIndex
public int getMaxDocsForInMemoryIndex()
Description copied from interface:LuceneConfigMax docs to allow for in memory indexes (does no apply to merges)- Specified by:
getMaxDocsForInMemoryIndexin interfaceLuceneConfig- Returns:
- the maxDocsForInMemoryIndex
-
setMaxDocsForInMemoryIndex
public void setMaxDocsForInMemoryIndex(int maxDocsForInMemoryIndex)
- Specified by:
setMaxDocsForInMemoryIndexin interfaceLuceneConfig- Parameters:
maxDocsForInMemoryIndex- the maxDocsForInMemoryIndex to set
-
getMaxRamInMbForInMemoryMerge
public double getMaxRamInMbForInMemoryMerge()
Description copied from interface:LuceneConfigRam based limit for in memory merges- Specified by:
getMaxRamInMbForInMemoryMergein interfaceLuceneConfig- Returns:
- the maxRamInMbForInMemoryMerge
-
setMaxRamInMbForInMemoryMerge
public void setMaxRamInMbForInMemoryMerge(double maxRamInMbForInMemoryMerge)
- Specified by:
setMaxRamInMbForInMemoryMergein interfaceLuceneConfig- Parameters:
maxRamInMbForInMemoryMerge- the maxRamInMbForInMemoryMerge to set
-
getMaxRamInMbForInMemoryIndex
public double getMaxRamInMbForInMemoryIndex()
Description copied from interface:LuceneConfigMax Ram to allow for in memory indexes (does not apply to merges)- Specified by:
getMaxRamInMbForInMemoryIndexin interfaceLuceneConfig- Returns:
- the maxRamInMbForInMemoryIndex
-
setMaxRamInMbForInMemoryIndex
public void setMaxRamInMbForInMemoryIndex(double maxRamInMbForInMemoryIndex)
- Specified by:
setMaxRamInMbForInMemoryIndexin interfaceLuceneConfig- Parameters:
maxRamInMbForInMemoryIndex- the maxRamInMbForInMemoryIndex to set
-
getMergerRamBufferSizeMb
public double getMergerRamBufferSizeMb()
Description copied from interface:LuceneConfigRam based limit for in memory portion of merger index.- Specified by:
getMergerRamBufferSizeMbin interfaceLuceneConfig- Returns:
- the mergerRamBufferSizeMb
-
setMergerRamBufferSizeMb
public void setMergerRamBufferSizeMb(double mergerRamBufferSizeMb)
- Specified by:
setMergerRamBufferSizeMbin interfaceLuceneConfig- Parameters:
mergerRamBufferSizeMb- the mergerRamBufferSizeMb to set
-
getWriterRamBufferSizeMb
public double getWriterRamBufferSizeMb()
Description copied from interface:LuceneConfigRam based limit for in memory portion of writer index.- Specified by:
getWriterRamBufferSizeMbin interfaceLuceneConfig- Returns:
- the writerRamBufferSizeMb
-
setWriterRamBufferSizeMb
public void setWriterRamBufferSizeMb(double writerRamBufferSizeMb)
- Specified by:
setWriterRamBufferSizeMbin interfaceLuceneConfig- Parameters:
writerRamBufferSizeMb- the writerRamBufferSizeMb to set
-
isContentIndexingEnabled
public boolean isContentIndexingEnabled()
- Specified by:
isContentIndexingEnabledin interfaceLuceneConfig- Returns:
- if content indexing is enable.
-
setContentIndexingEnabled
public void setContentIndexingEnabled(boolean contentIndexingEnabled)
Description copied from interface:LuceneConfigEnable/Disable the indexing of content Content is not indexed and FTS disabled When disabled, documents are marked as requiring FTS indexing. When enabled the normal FTS process will catch up with content that was not indexed.- Specified by:
setContentIndexingEnabledin interfaceLuceneConfig- Parameters:
contentIndexingEnabled- boolean
-
getQueryLanguage
protected LuceneQueryLanguageSPI getQueryLanguage(java.lang.String name)
-
getAllStores
protected abstract java.util.List<org.alfresco.service.cmr.repository.StoreRef> getAllStores()
-
doReadOnly
public <R> R doReadOnly(LuceneIndexerAndSearcher.ReadOnlyWork<R> lockWork)
- Specified by:
doReadOnlyin interfaceLuceneIndexerAndSearcher
-
main
public static void main(java.lang.String[] args) throws java.io.IOException- Throws:
java.io.IOException
-
deleteDirectory
public static void deleteDirectory(java.io.File directory) throws java.io.IOException- Throws:
java.io.IOException
-
destroy
public void destroy() throws java.lang.Exception- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
java.lang.Exception
-
-