Package com.atlassian.confluence.search
Interface IndexManager
- All Known Implementing Classes:
CompositeIndexManager
public interface IndexManager
The entry point to the Indexing Subsystem.
- Since:
- 5.10
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumEnum indicating the mode in which to flush the queue. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTask(ConfluenceIndexTask task) Adds a new task to the index queuedefault booleanFlushes the index queue, processing all of the tasks.booleanflushQueue(IndexManager.IndexQueueFlushMode flushMode) Flushes the index queue, processing a batch of the tasksbooleanflushQueueWithLockTimeout(IndexManager.IndexQueueFlushMode flushMode, int lockTimeout, TimeUnit lockTimeoutUnit) Flushes the index queue with a specified lock timeout.intDeprecated.booleanReturns true if the index queue is currently being flushed.default booleanReturns true if the system is currently being reindexed.default voidRefresh the index immediately, which publishes its most recent changes and makes them available for searching.default ReIndexTaskreIndex()Triggers a system wide reindex of all content.reIndex(EnumSet<ReIndexOption> options) Triggers a system wide reindex with specified options, entities are loaded from the database.reIndex(EnumSet<ReIndexOption> options, SearchQuery searchQuery) Triggers a system wide re-index.reIndex(EnumSet<ReIndexOption> options, @NonNull List<String> spaceKeys) voidResets the index queue removes all entries from the queue without processing them.void
-
Field Details
-
REINDEX_SPACES_DARK_FEATURE
- See Also:
-
-
Method Details
-
isFlushing
boolean isFlushing()Returns true if the index queue is currently being flushed.- Returns:
- true if flushing, false otherwise.
-
isReIndexing
default boolean isReIndexing()Returns true if the system is currently being reindexed.- Returns:
- true if flushing, false otherwise.
-
flushQueue
Flushes the index queue, processing a batch of the tasks- Parameters:
flushMode- - whether to flush the entire queue, or just one batch of batchsize as specified by the system property index.queue.batch.size- Returns:
- whether the flush actually took place
-
flushQueueWithLockTimeout
boolean flushQueueWithLockTimeout(IndexManager.IndexQueueFlushMode flushMode, int lockTimeout, TimeUnit lockTimeoutUnit) Flushes the index queue with a specified lock timeout. This method processes a batch of tasks from the index queue, allowing the caller to define a custom timeout for acquiring a lock on the index.- Parameters:
flushMode- Specifies whether to flush the entire queue or just a batch of tasks. The batch size is determined by the system propertyindex.queue.batch.size.lockTimeout- The maximum time to wait for acquiring the lock, specified as an integer value.lockTimeoutUnit- The unit of time for the lock timeout, specified as aTimeUnit.- Returns:
trueif the queue was successfully flushed,falseotherwise.- See Also:
-
flushQueue
default boolean flushQueue()Flushes the index queue, processing all of the tasks.- Returns:
- whether the flush actually took place
-
reIndex
Triggers a system wide reindex of all content. -
reIndex
Triggers a system wide reindex with specified options, entities are loaded from the database. -
reIndex
Triggers a system wide re-index.- Parameters:
options- Optional. Allows a subset of all searchable content to be re-indexed.searchQuery- A query that is used to load the entities to be re-indexed.
-
reIndex
-
unIndexAll
void unIndexAll() -
getLastReindexingTask
ReIndexTask getLastReindexingTask() -
resetIndexQueue
void resetIndexQueue()Resets the index queue removes all entries from the queue without processing them. -
getTaskQueue
Deprecated.since 7.9.0 UseIndexManagermethods instead of calling corresponding methods on queue directly. This method is deprecated because Confluence will no longer have only one index queueRetrieves the index task queue that is being used by this manager. -
getLastNonEmptyFlushStats
FlushStatistics getLastNonEmptyFlushStats() -
getQueueSize
int getQueueSize()- Returns:
- the number of pending items in the corresponding index queue
- Since:
- 7.9.0
-
addTask
Adds a new task to the index queue -
refreshIndex
Refresh the index immediately, which publishes its most recent changes and makes them available for searching. This method is only applicable to the OpenSearch platform.- Throws:
IOException
-
IndexManagermethods instead of calling corresponding methods on queue directly.