(ejabberd@meta)51> ejabberd_riak:set_with_index(<<"test1">>, "a", "A", [{<<"author_reship_bin">>, list_to_binary("lang_a")}]).
ok
(ejabberd@meta)52> ejabberd_riak:list_keys(<<"test1">>).
["a"]
(ejabberd@meta)53> ejabberd_riak:set_with_index(<<"test1">>, "b", "B", [{<<"author_reship_bin">>, list_to_binary("lang_b")}]).
ok
(ejabberd@meta)54> ejabberd_riak:set_with_index(<<"test1">>, "c", "C", [{<<"author_reship_bin">>, list_to_binary("lang_c")}]).
["b","a","c"]
(ejabberd@meta)59> ejabberd_riak:list_keys(<<"test1">>).
["c","b","a"]
(ejabberd@meta)60>
(ejabberd@meta)61> f(Pid), {ok, Pid} = riakc_pb_socket:start_link("127.0.0.1", 8087).
{ok,<0.747.0>}
(ejabberd@meta)62> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"lang_a">>, <<"lang_b">>).
{ok,[<<131,107,0,1,98>>,<<131,107,0,1,97>>]}
(ejabberd@meta)63>
(ejabberd@meta)63> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"lang_a">>, <<"lang_c">>).
{ok,[<<131,107,0,1,98>>,
<<131,107,0,1,97>>,
<<131,107,0,1,99>>]}
(ejabberd@meta)64>
(ejabberd@meta)68> ejabberd_riak:set_with_index(<<"test1">>, "a", "A", [{<<"author_reship_bin">>, list_to_binary("langxw_langzhe")}]).
ok
(ejabberd@meta)69> ejabberd_riak:set_with_index(<<"test1">>, "b", "B", [{<<"author_reship_bin">>, list_to_binary("langxw_langxw")}]).
ok
(ejabberd@meta)70> ejabberd_riak:set_with_index(<<"test1">>, "c", "C", [{<<"author_reship_bin">>, list_to_binary("langxw_langxw")}]).
ok
(ejabberd@meta)71> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"">>, <<"lang_c">>).
{ok,[]}
(ejabberd@meta)72>
(ejabberd@meta)72> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"">>, <<"langxw_">>).
{ok,[]}
(ejabberd@meta)73>
(ejabberd@meta)73> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"">>, <<"langxw_langxw">>).
{ok,[<<131,107,0,1,99>>,<<131,107,0,1,98>>]}
(ejabberd@meta)74>
(ejabberd@meta)74> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"">>, <<"langxw_langzhe">>).
{ok,[<<131,107,0,1,97>>,
<<131,107,0,1,98>>,
<<131,107,0,1,99>>]}
(ejabberd@meta)75>
(ejabberd@meta)75> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"langzhe">>, <<"langxw_langzhe">>).
{ok,[<<131,107,0,1,97>>]}
(ejabberd@meta)76>
(ejabberd@meta)76> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"langzhe">>, <<"langxw">>).
{ok,[<<131,107,0,1,97>>,
<<131,107,0,1,98>>,
<<131,107,0,1,99>>]}
(ejabberd@meta)77>
(ejabberd@meta)77> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"lang">>, <<"langxw">>).
{ok,[]}
(ejabberd@meta)78>
(ejabberd@meta)78> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"lang">>, <<"lang">>).
{ok,[]}
(ejabberd@meta)79>
(ejabberd@meta)79> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"langzhe">>, <<"langxw">>).
{ok,[<<131,107,0,1,98>>,
<<131,107,0,1,99>>,
<<131,107,0,1,97>>]}
(ejabberd@meta)80>
(ejabberd@meta)80> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"langzhe">>, <<"langzhe">>).
{ok,[]}
(ejabberd@meta)81>
(ejabberd@meta)81> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"">>, <<"langzhe">>).
{ok,[<<131,107,0,1,99>>,
<<131,107,0,1,97>>,
<<131,107,0,1,98>>]}
(ejabberd@meta)82>
(ejabberd@meta)82> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"">>, <<"">>).
{ok,[]}
(ejabberd@meta)83>
(ejabberd@meta)83> riakc_pb_socket:get_index(Pid, <<"test1">>, <<"author_reship_bin">>, <<"">>, <<"langzhe">>).
{ok,[<<131,107,0,1,99>>,
<<131,107,0,1,97>>,
<<131,107,0,1,98>>]}