Interface IndexManager

All Known Implementing Classes:
CompositeIndexManager

public interface IndexManager
The entry point to the Indexing Subsystem.
Since:
5.10
  • Field Details

  • 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

      boolean flushQueue(IndexManager.IndexQueueFlushMode flushMode)
      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 property index.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 a TimeUnit.
      Returns:
      true if the queue was successfully flushed, false otherwise.
      See Also:
    • flushQueue

      default boolean flushQueue()
      Flushes the index queue, processing all of the tasks.
      Returns:
      whether the flush actually took place
    • reIndex

      default ReIndexTask reIndex()
      Triggers a system wide reindex of all content.
    • reIndex

      ReIndexTask reIndex(EnumSet<ReIndexOption> options)
      Triggers a system wide reindex with specified options, entities are loaded from the database.
    • reIndex

      ReIndexTask reIndex(EnumSet<ReIndexOption> options, SearchQuery searchQuery)
      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

      ReIndexTask reIndex(EnumSet<ReIndexOption> options, @NonNull List<String> spaceKeys)
    • unIndexAll

      void unIndexAll()
    • getLastReindexingTask

      ReIndexTask getLastReindexingTask()
    • resetIndexQueue

      void resetIndexQueue()
      Resets the index queue removes all entries from the queue without processing them.
    • getTaskQueue

      @Deprecated IndexTaskQueue getTaskQueue()
      Deprecated.
      since 7.9.0 Use IndexManager methods instead of calling corresponding methods on queue directly. This method is deprecated because Confluence will no longer have only one index queue
      Retrieves 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

      void addTask(ConfluenceIndexTask task)
      Adds a new task to the index queue
    • refreshIndex

      default void refreshIndex() throws IOException
      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