1

Is there a way to use the Java client to create a secondary index on values that are maps in Riak? The code I have for creating the map is as follows

        RegisterUpdate value = new RegisterUpdate(rawValue);
        MapUpdate data = new MapUpdate().update("key", value);
        UpdateMap request = new UpdateMap.Builder(location, data)
                .withReturnDatatype(true).build();
        client.execute(request);

The documentation only shows how to do it with RiakObject types, which have a getIndexes method where you can get a specif index and add/remove values from it. I haven't found anything for any of the CRDT types.

wegrata
  • 1,596
  • 1
  • 15
  • 19

1 Answers1

2

Unfortunately secondary indexes are not supported for the Riak Data Types (map, flag, counter, set, register). Instead of 2i you will want to look at Riak Search 2.0: http://docs.basho.com/riak/latest/dev/search/search-data-types/

Craig
  • 1,001
  • 6
  • 11