basho / riak-erlang-client

The Riak client for Erlang.
Apache License 2.0
311 stars 188 forks source link

Programmatically adding search indexes to CRDTs [JIRA: CLIENTS-1028] #331

Open mikrofusion opened 7 years ago

mikrofusion commented 7 years ago

It appears I can use `riakc_pb_socket.set_search_index to set a search index to a bucket within a bucket type, but not to the overall type programatically.

I am trying to find a way to get the same behavior I can get using riak-admin on the command line.

For example, if I run

riak-admin bucket-type update counters '{"props":{"search_index":"counter_search"}}'

I can see that the counter_search index gets added to the console:

screen shot 2016-11-10 at 4 34 15 pm

But, if I do this via code:

  :ok = :riakc_pb_socket.set_search_index(shared.pid, {"counters", shared.bucket}, "counter_search")

The result is that no index is found:

screen shot 2016-11-10 at 4 33 41 pm

I've tried variations of set_search_index with no avail:

  :ok = :riakc_pb_socket.set_search_index(shared.pid, "counters", "counter_search")

Thanks in advance for any help you can provide.