Hi,
I am using Java client 2.7.16, I am trying to create the index using java client below is the code snippet for the same.
String nQuery = CREATE INDEX ix_name ON bucket-name
(name) WITH {“num_replica”: 1}; --> this comes dynamically
Bucket bucket = getBucket(instance);
N1qlQueryResult result = bucket.query(N1qlQuery.simple(nQuery));
It throws an exception "nested exception is java.lang.NoSuchMethodError: io.opentracing.Tracer$SpanBuilder.startActive(Z)Lio/opentracing/Scope;"
can you please help me solve this issue, I want to use bucket.query(N1qlQuery.simple(nQuery)); this method only to create index, as they query comes dynamically so I do not want to alter the query.
I tried with java client 3.0.0 version also but it throws error unable to parse the scheme exception.
below is the code snippet I used for 3.0.0 version
Cluster cluster = Cluster.connect(“http://” + instance.getCluster().getClusterAddress(), instance.getBucket().getUserid(),
new String(Base64.getDecoder().decode(instance.getBucket().getPassword()), StandardCharsets.UTF_8) );
QueryResult queryResult = cluster.query(nQuery);
Please suggest me how can I create the index using java client with plain query like CREATE INDEX ix_name ON bucket-name
(name)
Thanks