|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.search.impl.lucene.AbstractLuceneBase
public abstract class AbstractLuceneBase
Common support for abstracting the lucene indexer from its configuration and management requirements.
This class defines where the indexes are stored. This should be via a configurable Bean property in Spring.
The default file structure is
The IndexWriter and IndexReader for a given index are toggled (one should be used for delete and the other for write). These are reused/closed/initialised as required.
The index deltas are buffered to memory and persisted in the file system as required.
Field Summary | |
---|---|
protected java.lang.String |
deltaId
The identifier for the delta |
protected org.alfresco.service.cmr.repository.StoreRef |
store
The identifier for the store |
Constructor Summary | |
---|---|
AbstractLuceneBase()
|
Method Summary | |
---|---|
protected void |
closeDeltaReader()
Close the on file reader for the delta if it is open |
protected void |
closeDeltaWriter()
Close the on disk delta writer |
void |
deleteIndex()
|
java.lang.Object |
doReadOnly(IndexInfo.LockWork lockWork)
Execute actions against a read only index (all write ops will block) |
java.lang.String |
getDeltaId()
Get the ID for the delat we are working with. |
protected org.apache.lucene.index.IndexReader |
getDeltaReader()
Get a reader for the on file portion of the delta |
protected org.apache.lucene.index.IndexWriter |
getDeltaWriter()
Get the on file writer for the delta |
org.alfresco.service.cmr.dictionary.DictionaryService |
getDictionaryService()
Get the dictionary service. |
LuceneConfig |
getLuceneConfig()
Get the lucene configuration options. |
protected org.apache.lucene.index.IndexReader |
getReader()
|
protected org.apache.lucene.search.IndexSearcher |
getSearcher()
Get a searcher for the main index TODO: Split out support for the main index. |
protected ClosingIndexSearcher |
getSearcher(LuceneIndexer luceneIndexer)
|
protected TransactionStatus |
getStatus()
|
protected void |
initialise(org.alfresco.service.cmr.repository.StoreRef store,
java.lang.String deltaId)
Initialise the configuration elements of the lucene store indexers and searchers. |
protected void |
saveDelta()
Save the in memory delta to the disk, make sure there is nothing held in memory |
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Set the dictionary service |
protected void |
setInfo(long docs,
java.util.Set deletions,
java.util.Set containerDeletions,
boolean deleteNodesOnly)
|
void |
setLuceneConfig(LuceneConfig config)
Set the lucene configuration options |
protected void |
setStatus(TransactionStatus status)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.alfresco.service.cmr.repository.StoreRef store
protected java.lang.String deltaId
Constructor Detail |
---|
public AbstractLuceneBase()
Method Detail |
---|
protected void initialise(org.alfresco.service.cmr.repository.StoreRef store, java.lang.String deltaId) throws LuceneIndexException
store
- deltaId
-
java.io.IOException
LuceneIndexException
protected org.apache.lucene.search.IndexSearcher getSearcher() throws LuceneIndexException
java.io.IOException
LuceneIndexException
protected ClosingIndexSearcher getSearcher(LuceneIndexer luceneIndexer) throws LuceneIndexException
LuceneIndexException
protected org.apache.lucene.index.IndexReader getDeltaReader() throws LuceneIndexException, java.io.IOException
java.io.IOException
java.io.IOException
LuceneIndexException
protected void closeDeltaReader() throws LuceneIndexException, java.io.IOException
java.io.IOException
java.io.IOException
LuceneIndexException
protected org.apache.lucene.index.IndexWriter getDeltaWriter() throws LuceneIndexException, java.io.IOException
java.io.IOException
java.io.IOException
LuceneIndexException
protected void closeDeltaWriter() throws LuceneIndexException, java.io.IOException
java.io.IOException
java.io.IOException
LuceneIndexException
protected void saveDelta() throws LuceneIndexException, java.io.IOException
java.io.IOException
java.io.IOException
LuceneIndexException
protected void setInfo(long docs, java.util.Set deletions, java.util.Set containerDeletions, boolean deleteNodesOnly) throws java.io.IOException
java.io.IOException
protected void setStatus(TransactionStatus status) throws java.io.IOException
java.io.IOException
protected TransactionStatus getStatus()
protected org.apache.lucene.index.IndexReader getReader() throws LuceneIndexException, java.io.IOException
LuceneIndexException
java.io.IOException
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
dictionaryService
- public org.alfresco.service.cmr.dictionary.DictionaryService getDictionaryService()
public void setLuceneConfig(LuceneConfig config)
config
- public LuceneConfig getLuceneConfig()
public java.lang.String getDeltaId()
public java.lang.Object doReadOnly(IndexInfo.LockWork lockWork)
lockWork
-
public void deleteIndex()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |