public class LuceneUpdateService extends Object
addWorkitem() a
ItemCollection can be added to a lucene search index. The service init method
reads the property file 'imixs.properties' from the current classpath to
determine the configuration.
did-not-update-the-index-when-called-from-a-web-modul,
LucenePlugin| Modifier and Type | Field and Description |
|---|---|
protected static String |
ANONYMOUS |
protected static String |
DEFAULT_ANALYSER |
protected static String |
DEFAULT_INDEX_DIRECTORY |
protected static int |
EVENTLOG_ENTRY_FLUSH_COUNT |
protected static String |
EVENTLOG_ID_PRAFIX |
static String |
EVENTLOG_TYPE_ADD |
static String |
EVENTLOG_TYPE_REMOVE |
| Constructor and Description |
|---|
LuceneUpdateService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
flushEventLog(int junkSize)
Flush the EventLog cache.
|
ItemCollection |
getConfiguration()
Returns the Lucene configuration
|
void |
removeDocument(String uniqueID)
This method adds a new eventLogEntry for a document to be deleted from the
index.
|
void |
updateDocument(ItemCollection documentContext)
This method adds a single document into the to the Lucene index.
|
void |
updateDocuments(Collection<ItemCollection> documents)
This method adds a collection of documents to the Lucene index.
|
void |
updateDocumentsUncommitted(Collection<ItemCollection> documents)
This method adds a collection of documents to the Lucene index.
|
protected static final String DEFAULT_ANALYSER
protected static final String DEFAULT_INDEX_DIRECTORY
protected static final String ANONYMOUS
public static final String EVENTLOG_TYPE_ADD
public static final String EVENTLOG_TYPE_REMOVE
protected static final String EVENTLOG_ID_PRAFIX
protected static final int EVENTLOG_ENTRY_FLUSH_COUNT
public ItemCollection getConfiguration()
public void updateDocument(ItemCollection documentContext)
The method supports committed read. This means that a running transaction will not read an uncommitted document from the Lucene index.
documentContext - public void updateDocuments(Collection<ItemCollection> documents)
The method supports committed read. This means that a running transaction will not read uncommitted documents from the Lucene index.
documents - to be indexedIndexExceptionupdateDocumentsUncommittedpublic void updateDocumentsUncommitted(Collection<ItemCollection> documents)
This method is used by the JobHandlerRebuildIndex only.
documents - of ItemCollections to be indexedIndexExceptionpublic void removeDocument(String uniqueID)
uniqueID - of the workitem to be removedPluginExceptionpublic boolean flushEventLog(int junkSize)
The method flushes the cache in smaller blocks of the given junkSize. to avoid a heap size problem. The default flush size is 16. The eventLog cache is tracked by the flag 'dirtyIndex'.
issue #439 - The method returns false if the event log contains more entries as defined by the given JunkSize. In this case the caller should recall the method which runs always in a new transaction. The goal of this mechanism is to reduce the event log even in cases the outer transaction breaks.
LuceneSearchServiceCopyright © 2006–2019 Imixs Software Solutions GmbH. All rights reserved.