Class ReactiveSearchIndexManager


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

      • ReactiveSearchIndexManager

        public ReactiveSearchIndexManager​(AsyncSearchIndexManager asyncSearchIndexManager)
    • Method Detail

      • get

        public Mono<SearchIndex> get​(String name)
        Fetches an already created index from the server.
        Parameters:
        name - the name of the search index.
        Returns:
        a Mono that will complete once the index definition is loaded.
      • insert

        public Mono<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 Mono that will complete once the index definition is inserted.
      • replace

        public Mono<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) (SearchIndex)} instead.

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

        public Mono<Void> remove​(String name)
        Removes a search index from the cluster.
        Parameters:
        name - the name of the index.
        Returns:
        a Mono that completes once the index is removed.