Skip to content
This repository was archived by the owner on Aug 13, 2026. It is now read-only.
This repository was archived by the owner on Aug 13, 2026. It is now read-only.

Add support bucket index [JIRA: CLIENTS-879] #622

Description

@tomaszszlek

Hi,
I would like to use $bucket secondary index using java riak client.
I have noticed that such possibility was added some time ago in: #129.
It seems that in current version we can't use $bucket index in Java client (I am using client ver. 2.1.4).
In documentation there is a note that we can use it via REST API: http://docs.basho.com/riak/kv/2.1.4/developing/usage/secondary-indexes/#retrieve-all-bucket-keys-via-the-bucket-index
but there is no example how to do it in java.
The old code, which was added in #129 look like follows:
final Bucket b = riakClient.fetchBucket(bucketName).execute(); all = b.fetchIndex(BucketIndex.index).withValue("_").execute();

Activity

  1. changed the title [-]Add support bucket index[/-] [+]Add support bucket index [JIRA: CLIENTS-879][/+] on May 31, 2016
  2. alexmoore commented on Jul 20, 2016

    @alexmoore
    Contributor

    Hi @tomaszszlek,

    You can do a $bucket index query with:

    RawIndexQuery biq  =
                new RawIndexQuery.Builder(namespace, "$bucket", Type._BUCKET, bucketName)
                    .withKeyAndIndex(true).build();

    RawIndexQuery biq =
    new RawIndexQuery.Builder(ns, "$bucket", Type._BUCKET, bucketName)
    .withKeyAndIndex(true).build();

    It is a little duplicative, so I'll see if we can make a streamlined command in the future.

  3. alexmoore commented on Aug 4, 2016

    @alexmoore
    Contributor

    Hi @tomaszszlek,

    I had a few free hours so I made a set of specialized $bucket and $key index commands, and they should be much more straightforward to use. Look for them in the next release!

    Thanks,
    Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions