Interface SearchEngine.ForIndices

Enclosing interface:
SearchEngine

public static interface SearchEngine.ForIndices
Api for modifying multiple indices at once.
Since:
2.23.0
  • Method Details

    • matching

      This method can be used to filter the indices. If no predicate is used the tasks are enqueued for every existing index.
      Parameters:
      predicate - predicate to filter indices
      Returns:
      this
    • forResource

      SearchEngine.ForIndices forResource(String resource)
      Apply a lock for a specific resource. By default, a lock for the whole index is used. If one or more specific resources are locked, than the lock is applied only for those resources and tasks which targets other resources of the same index can run in parallel.
      Parameters:
      resource - specific resource to lock
      Returns:
      this
    • forResource

      default SearchEngine.ForIndices forResource(ModelObject resource)
      This method is a shortcut for forResource(String) with the id of the given resource.
      Parameters:
      resource - resource in form of model object
      Returns:
      this
    • batch

      void batch(SerializableIndexTask<?> task)
      Submits the task and execute it for every index which are matching the predicate (matching(Predicate). The task is executed asynchronous and will be finished some time in the future. Note: the task must be serializable because it is submitted to the CentralWorkQueue. For more information on task serialization have a look at the CentralWorkQueue documentation.
      Parameters:
      task - serializable task for updating multiple indices
    • batch

      void batch(Class<? extends IndexTask<?>> task)
      Submits the task and executes it for every index which are matching the predicate (matching(Predicate). The task is executed asynchronously and will finish at some unknown point in the future.
      Parameters:
      task - task for updating multiple indices