How to create FTS index from Couchbase Java SDK?

Hello,

is it possible to create a FTS index using Java SDK? Or just with a REST API and Admin UI?

Thank you,
Darek

Hello, I am new here

Assignment Help UAE

It is possible. There seems to be a class called UpsertSearchIndexRequest which can be sent using the ClusterFacade#send method.

Something like this should work:

			CouchbaseCluster couchbaseCluster = CouchbaseCluster.create("localhost");
		CouchbaseResponse response = couchbaseCluster.core()
				.send(new UpsertSearchIndexRequest("indexName", "json payload here", "user", "pass"))
				.toBlocking()
				.single();
		System.out.println(response.status().isSuccess());
1 Like