Package sonia.scm.search
Interface SearchEngine.ForIndices
- Enclosing interface:
- SearchEngine
public static interface SearchEngine.ForIndices
Api for modifying multiple indices at once.
- Since:
- 2.23.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Submits the task and executes it for every index which are matching the predicate (matching(Predicate)
.void
batch
(SerializableIndexTask<?> task) Submits the task and execute it for every index which are matching the predicate (matching(Predicate)
.forResource
(String resource) Apply a lock for a specific resource.default SearchEngine.ForIndices
forResource
(ModelObject resource) This method is a shortcut forforResource(String)
with the id of the given resource.matching
(Predicate<IndexDetails> predicate) This method can be used to filter the indices.
-
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
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
This method is a shortcut forforResource(String)
with the id of the given resource.- Parameters:
resource
- resource in form of model object- Returns:
this
-
batch
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 theCentralWorkQueue
. For more information on task serialization have a look at theCentralWorkQueue
documentation.- Parameters:
task
- serializable task for updating multiple indices
-
batch
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
-