Class SearchWorkspaceImpl

java.lang.Object
org.hibernate.search.mapper.orm.work.impl.SearchWorkspaceImpl
All Implemented Interfaces:
SearchWorkspace

public class SearchWorkspaceImpl extends Object implements SearchWorkspace
  • Constructor Details

  • Method Details

    • mergeSegments

      public void mergeSegments()
      Description copied from interface: SearchWorkspace
      Merge all segments of the indexes targeted by this workspace into a single one.

      Note this operation may affect performance positively as well as negatively. See the reference documentation for more information.

      Specified by:
      mergeSegments in interface SearchWorkspace
    • mergeSegmentsAsync

      public CompletableFuture<?> mergeSegmentsAsync()
      Description copied from interface: SearchWorkspace
      Asynchronous version of SearchWorkspace.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.

      Specified by:
      mergeSegmentsAsync in interface SearchWorkspace
      Returns:
      A CompletionStage reflecting the completion state of the operation.
      See Also:
    • purge

      public void purge()
      Description copied from interface: SearchWorkspace
      Delete all documents from indexes targeted by this workspace.

      With multi-tenancy enabled, only documents of the current tenant will be removed: the tenant that was targeted by the session from where this workspace originated.

      Specified by:
      purge in interface SearchWorkspace
    • purgeAsync

      public CompletableFuture<?> purgeAsync()
      Description copied from interface: SearchWorkspace
      Asynchronous version of SearchWorkspace.purge(), returning as soon as the operation is queued.
      Specified by:
      purgeAsync in interface SearchWorkspace
      Returns:
      A CompletionStage reflecting the completion state of the operation.
      See Also:
    • purge

      public void purge(Set<String> routingKeys)
      Description copied from interface: SearchWorkspace
      Delete documents from indexes targeted by this workspace that were indexed with any of the given routing keys.

      With multi-tenancy enabled, only documents of the current tenant will be removed: the tenant that was targeted by the session from where this workspace originated.

      Specified by:
      purge in interface SearchWorkspace
      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.
    • purgeAsync

      public CompletableFuture<?> purgeAsync(Set<String> routingKeys)
      Description copied from interface: SearchWorkspace
      Asynchronous version of SearchWorkspace.purge(Set), returning as soon as the operation is queued.
      Specified by:
      purgeAsync in interface SearchWorkspace
      Parameters:
      routingKeys - The set of routing keys.
      Returns:
      A CompletionStage reflecting the completion state of the operation.
      See Also:
    • flush

      public void flush()
      Description copied from interface: SearchWorkspace
      Flush to disk the changes to indexes 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.

      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 SearchWorkspace.flush() is called, in particular operations queued as part of processing an indexing plan before a transaction is committed. These operations will not be applied immediately just because a call to SearchWorkspace.flush() is issued: the "flush" here is a very low-level operation handled by the backend.

      Specified by:
      flush in interface SearchWorkspace
    • flushAsync

      public CompletableFuture<?> flushAsync()
      Description copied from interface: SearchWorkspace
      Asynchronous version of SearchWorkspace.flush(), returning as soon as the operation is queued.
      Specified by:
      flushAsync in interface SearchWorkspace
      Returns:
      A CompletionStage reflecting the completion state of the operation.
      See Also:
    • refresh

      public void refresh()
      Description copied from interface: SearchWorkspace
      Refresh the indexes so that all changes executed so far will be visible in search queries.

      This is generally not useful as indexes are refreshed automatically, either after every change (default for the Lucene backend) or periodically (default for the Elasticsearch backend, possible for the Lucene backend by setting a refresh interval). Only to be used by experts fully aware of the implications.

      Note that some operations may still be waiting in a queue when SearchWorkspace.refresh() is called, in particular operations queued as part of processing an indexing plan before a transaction is committed. These operations will not be applied immediately just because a call to SearchWorkspace.refresh() is issued: the "refresh" here is a very low-level operation handled by the backend.

      Specified by:
      refresh in interface SearchWorkspace
    • refreshAsync

      public CompletableFuture<?> refreshAsync()
      Description copied from interface: SearchWorkspace
      Asynchronous version of SearchWorkspace.refresh(), returning as soon as the operation is queued.
      Specified by:
      refreshAsync in interface SearchWorkspace
      Returns:
      A CompletionStage reflecting the completion state of the operation.
      See Also: