How to create FTS index from Couchbase Java SDK?

java
index
sdk

#1

Hello,

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

Thank you,
Darek


#2

Hello, I am new here

Assignment Help UAE


#3

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());