public interface SearchWorkspace
A SearchWorkspace targets a pre-defined set of indexed types (and their indexes),
filtered to only affect a single tenant, if relevant.
While automatic indexing
generally takes care of indexing entities as they are persisted/deleted in the database,
there are cases where massive operations must be applied to the index,
such as completely purging the index.
This is where the SearchWorkspace comes in.
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Flush to disk the changes to indexes that were not committed yet.
|
CompletableFuture<?> |
flushAsync()
Asynchronous version of
flush(), returning as soon as the operation is queued. |
void |
mergeSegments()
Merge all segments of the indexes targeted by this workspace into a single one.
|
CompletableFuture<?> |
mergeSegmentsAsync()
Asynchronous version of
mergeSegments(), returning as soon as the operation is queued. |
void |
purge()
Purge the data targeted by this workspaces, removing all documents.
|
CompletableFuture<?> |
purgeAsync()
Asynchronous version of
purge(), returning as soon as the operation is queued. |
void purge()
When using multi-tenancy, only documents of one tenant will be removed: the tenant that was targeted by the session from where this workspace originated.
CompletableFuture<?> purgeAsync()
purge(), returning as soon as the operation is queued.CompletableFuture reflecting the completion state of the operation.purge()void flush()
This is generally not useful as Hibernate Search commits changes automatically. Only to be used by experts fully aware of the implications.
Note that some operations may still be waiting in a queue when flush() is called,
in particular operations queued as part of automatic indexing before a transaction
is committed.
These operations will not be applied immediately just because a call to flush() is issued:
the "flush" here is a very low-level operation managed by the backend.
CompletableFuture<?> flushAsync()
flush(), returning as soon as the operation is queued.CompletableFuture reflecting the completion state of the operation.flush()void mergeSegments()
Note this operation may affect performance positively as well as negatively. See the reference documentation for more information.
CompletableFuture<?> mergeSegmentsAsync()
mergeSegments(), returning as soon as the operation is queued.
Note this operation may affect performance positively as well as negatively. See the reference documentation for more information.
CompletableFuture reflecting the completion state of the operation.mergeSegments()Copyright © 2006-2020 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.