Class SearchIndexManager


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

      • get

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

        public 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.
      • replace

        public 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).
      • remove

        public void remove​(String name)
        Removes a search index from the cluster.
        Parameters:
        name - the name of the index.