Interface IndexWorkspace
public interface IndexWorkspace
The entry point for explicit index operations on a single index.
-
Method Summary
Modifier and TypeMethodDescriptionflush
(OperationSubmitter operationSubmitter, UnsupportedOperationBehavior unsupportedOperationBehavior) Flush to disk the changes to the index that were not committed yet.mergeSegments
(OperationSubmitter operationSubmitter, UnsupportedOperationBehavior unsupportedOperationBehavior) Merge all segments of the index into a single one.purge
(Set<String> routingKeys, OperationSubmitter operationSubmitter, UnsupportedOperationBehavior unsupportedOperationBehavior) Delete documents that were indexed with any of the given routing keys, or all documents if the set of routing keys is empty.refresh
(OperationSubmitter operationSubmitter, UnsupportedOperationBehavior unsupportedOperationBehavior) Refresh the indexes so that all changes executed so far will be visible in search queries.
-
Method Details
-
mergeSegments
CompletableFuture<?> mergeSegments(OperationSubmitter operationSubmitter, UnsupportedOperationBehavior unsupportedOperationBehavior) Merge all segments of the index into a single one.- Parameters:
operationSubmitter
- The behavior to adopt when submitting the operation to a full queue/executor.unsupportedOperationBehavior
- The behavior to adopt if the operation is not supported in this index.- Returns:
- A completion stage for the executed operation, or a completed stage if the operation is not supported.
-
purge
CompletableFuture<?> purge(Set<String> routingKeys, OperationSubmitter operationSubmitter, UnsupportedOperationBehavior unsupportedOperationBehavior) Delete documents that were indexed with any of the given routing keys, or all documents if the set of routing keys is empty.- Parameters:
routingKeys
- The set of routing keys. If non-empty, only documents that were indexed with these routing keys will be deleted. If empty, documents will be deleted regardless of their routing key.operationSubmitter
- The behavior to adopt when submitting the operation to a full queue/executor.unsupportedOperationBehavior
- The behavior to adopt if the operation is not supported in this index.- Returns:
- A completion stage for the executed operation.
-
flush
CompletableFuture<?> flush(OperationSubmitter operationSubmitter, UnsupportedOperationBehavior unsupportedOperationBehavior) Flush to disk the changes to the index that were not committed yet.In the case of backends with a transaction log (Elasticsearch), also apply operations from the transaction log that were not applied yet.
- Parameters:
operationSubmitter
- The behavior to adopt when submitting the operation to a full queue/executor.unsupportedOperationBehavior
- The behavior to adopt if the operation is not supported in this index.- Returns:
- A completion stage for the executed operation, or a completed stage if the operation is not supported.
-
refresh
CompletableFuture<?> refresh(OperationSubmitter operationSubmitter, UnsupportedOperationBehavior unsupportedOperationBehavior) Refresh the indexes so that all changes executed so far will be visible in search queries.- Parameters:
operationSubmitter
- The behavior to adopt when submitting the operation to a full queue/executor.unsupportedOperationBehavior
- The behavior to adopt if the operation is not supported in this index.- Returns:
- A completion stage for the executed operation, or a completed stage if the operation is not supported.
-