Search in sources :

Example 1 with SearchIndexManager

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");
}
Also used : Bucket(com.couchbase.client.java.Bucket) SearchIndexManager(com.couchbase.client.java.manager.search.SearchIndexManager) SearchIndex(com.couchbase.client.java.manager.search.SearchIndex) Cluster(com.couchbase.client.java.Cluster)

Aggregations

Bucket (com.couchbase.client.java.Bucket)1 Cluster (com.couchbase.client.java.Cluster)1 SearchIndex (com.couchbase.client.java.manager.search.SearchIndex)1 SearchIndexManager (com.couchbase.client.java.manager.search.SearchIndexManager)1