Created
May 22, 2013 19:37
-
-
Save engelsanchez/5630275 to your computer and use it in GitHub Desktop.
Show dropped duplicates with return terms with new 2i pagination
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(dev1@127.0.0.1)2> {ok, PB} = riakc_pb_socket:start("127.0.0.1", 10017). | |
{ok,<0.4627.0>} | |
(dev1@127.0.0.1)7> B = <<"bucket">>, O1 = riakc_obj:new(B, <<"1">>, <<"1">>). | |
(dev1@127.0.0.1)10> Md = riakc_obj:get_metadata(O1). | |
(dev1@127.0.0.1)11> Md2 = riakc_obj:set_secondary_index(Md, {{integer_index, "i1"}, [1,2,3]}). | |
(dev1@127.0.0.1)12> O2 = riakc_obj:update_metadata(O1, Md2). | |
(dev1@127.0.0.1)13> riakc_pb_socket:put(PB, O2). | |
(dev1@127.0.0.1)22> riakc_pb_socket:get_index_range(PB, B, "i1_int", 1,3, [{max_results, 3}, {return_terms, true}]). | |
{ok,[{results,[{<<"1">>,<<"1">>}, | |
{<<"2">>,<<"1">>}, | |
{<<"3">>,<<"1">>}]}, | |
{continuation,<<"g2gCYQNtAAAAATE=">>}]} | |
(dev1@127.0.0.1)23> riakc_pb_socket:get_index_range(PB, B, "i1_int", 1,3, [{max_results, 2}, {return_terms, true}]). | |
{ok,[{results,[{<<"1">>,<<"1">>},{<<"2">>,<<"1">>}]}, | |
{continuation,<<"g2gCYQJtAAAAATE=">>}]} | |
(dev1@127.0.0.1)24> riakc_pb_socket:get_index_range(PB, B, "i1_int", 1,3, [{max_results, 2}, {return_terms, true}, {continuation, <<"g2gCYQJtAAAAATE=">>}]). | |
{ok,{keys,[]}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment