Class AsyncSearchIndexManager


  • public class AsyncSearchIndexManager
    extends Object
    The AsyncSearchIndexManager allows to manage search index structures in a couchbase cluster.
    Since:
    3.0.0
    • Constructor Detail

      • AsyncSearchIndexManager

        public AsyncSearchIndexManager​(Core core)
    • Method Detail

      • insert

        public CompletableFuture<Void> insert​(SearchIndex index)
        Inserts a search index which does not exist already.

        Note that you must create a new index with a new name using SearchIndex.from(String, SearchIndex) when fetching an index definition via get(String). Otherwise only replace can be used since a UUID is present which uniquely identifies an index definition on the cluster.

        Parameters:
        index - the name of the index.
        Returns:
        a CompletableFuture that will complete once the index definition is inserted.
      • replace

        public CompletableFuture<Void> replace​(SearchIndex index)
        Updates a previously loaded index with new params.

        It is important that the index needs to be loaded from the server when calling this method, since a UUID is present in the response and needs to be subsequently sent to the server on an update request. If you just want to create a new one, use insert(SearchIndex) instead.

        Parameters:
        index - the index previously loaded via get(String).
        Returns:
        a CompletableFuture that will complete once the index definition is updated.