我正在使用 Riak KV 2.1.1 的 Java 客户端。创建索引并将其应用到命名空间后,即使我遵循website上给出的文档,我仍然收到“找不到合适的方法”错误。 。 有什么办法解决这个问题吗?
谢谢。
请查看下面的代码和完整错误。
YokozunaIndex famousIndex = new YokozunaIndex("famous", "_yz_default");
StoreIndex storeIndex = new StoreIndex.Builder(famousIndex)
.build();
client.execute(storeIndex);
Namespace streets=new Namespace("streets");
StoreBucketPropsOperation storePropsOp = new StoreBucketPropsOperation.Builder(streets)
.withSearchIndex("famous")
.build();
client.execute(storePropsOp); // this is where I am getting error
最佳答案
这是一个文档错误。 RiakClient.execute()
接受 RiakCommand
的实例,而 StoreBucketPropsOperation
是较低级别的 API。
相反,请使用 StoreBucketProperties
命令,如下所示:
StoreBucketProperties storePropsCommand = new StoreBucketProperties.Builder(streets)
.withSearchIndex("famous")
.build();
client.execute(storePropsCommand);
关于java - Riak KV 2.1.1 Java客户端: No suitable method found for Client.执行(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43990033/