Hi Shimon,

The `fetchIndex` method is only available on the RawClient interface, I’ll see 
if we can get that post updated to reflect that.  

If you’re using the IRiakClient interface (likely), try fetching the index from 
a bucket object instead:

```
List<String> adminUserKeys = userBucket.fetchIndex(BinIndex.named(“user_group"))
                                                 
.withValue(“administrator").execute();
```

Also, what version of the Java client are you using?

Thanks,
Alex Moore

On November 25, 2013 at 3:34:45 AM, Shimon Benattar (shim...@gmail.com) wrote:

Hi, Riak users,

 

I am trying to index my data with the Java API

 

I saw on the basho site (http://basho.com/index-for-fun-and-for-profit/) the 
following code, The first part of creating the index works fine.

My problem here is that under riakClient I do not have any mothod called 
fetchIndex.

 

Can anyone assist here (I tried both http and pbc clients)?

 

Bucket userBucket = riakClient.fetchBucket("users").execute();

IRiakObject userObject = userBucket.fetch("thevegan3000").execute();

userObject.addIndex("user_group_bin", "administrator");

userBucket.store(userObject).execute();

 

BinIndex binIndex = BinIndex.named("user_group_bin");

BinValueQuery indexQuery = new BinValueQuery(binIndex, "users", 
"administrator");

List<String> adminUserKeys = riakClient.fetchIndex(indexQuery);

 

Thanks,

 

Shimon

_______________________________________________  
riak-users mailing list  
riak-users@lists.basho.com  
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com  
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to