Class SearchIndexManager
- java.lang.Object
-
- com.couchbase.client.java.manager.SearchIndexManager
-
public class SearchIndexManager extends Object
TheSearchIndexManager
allows to manage search index structures in a couchbase cluster.- Since:
- 3.0.0
-
-
Constructor Summary
Constructors Constructor Description SearchIndexManager(AsyncSearchIndexManager asyncIndexManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SearchIndex
get(String name)
Fetches an already created index from the server.void
insert(SearchIndex index)
Inserts a search index which does not exist already.void
remove(String name)
Removes a search index from the cluster.void
replace(SearchIndex index)
Updates a previously loaded index with new params.
-
-
-
Constructor Detail
-
SearchIndexManager
public SearchIndexManager(AsyncSearchIndexManager asyncIndexManager)
-
-
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 viaget(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 viaget(String)
.
-
remove
public void remove(String name)
Removes a search index from the cluster.- Parameters:
name
- the name of the index.
-
-