use of com.couchbase.client.java.manager.search.SearchIndexManager in project couchbase-jvm-clients by couchbase.
the class SearchIndexManagement method main.
public static void main(String... args) throws Exception {
Cluster cluster = Cluster.connect("127.0.0.1", "Administrator", "password");
Bucket bucket = cluster.bucket("travel-sample");
/*
* Provides access to the index manager.
*/
SearchIndexManager manager = cluster.searchIndexes();
/*
* Loads an index from cluster if it exists (will fail otherwise).
*/
SearchIndex index = manager.getIndex("ts");
/*
* Replaces or inserts the loaded index on the server.
*/
manager.upsertIndex(index);
/*
* Drops an index.
*/
manager.dropIndex("ts");
}
Aggregations