Reputation: 520
I am using Java client for Riak KV 2.1.1. After creating index and applying it to Namespace, I am getting the no suitable method found error even though I am following the documentation given on the website. What is the solution for this?
Thanks.
Please see the code and the full error below.
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
Upvotes: 1
Views: 91
Reputation: 3153
This is a documentation bug. RiakClient.execute()
accepts an instance of RiakCommand
, while StoreBucketPropsOperation
is a lower-level API.
Instead, use the StoreBucketProperties
command as follows:
StoreBucketProperties storePropsCommand = new StoreBucketProperties.Builder(streets)
.withSearchIndex("famous")
.build();
client.execute(storePropsCommand);
Upvotes: 2