Hello -
We're considering some changes to the Riak Search functionality in 
riak-erlang-client for the upcoming Riak 1.2 release. The current behavior of 
the riakc_pb_socket:search/* functions return a list in the form: [[Index, 
Id],[Index2,Id2],...]

With the new Riak Search protobuffs messages, we have the ability to also 
return fields from the search doc in the results (as additional values in the 
tuple). Also, it's possible to return the search results "max score", and 
"number found". Does anyone have any objections to returning additional fields? 
To maintain semi-compatible behavior, it's possible to use the fl (field limit) 
search option to just return the id.

Current behavior:
riakc_pb_socket:search(Pid, <<"phrases_custom">>, <<"phrase:fox">>).            
    
{ok,[[<<"phrases_custom">>,<<"5">>],
     [<<"phrases_custom">>,<<"1">>]]}

Proposed behavior:
riakc_pb_socket:search(Pid, <<"phrases_custom">>, <<"phrase:fox">>).
{ok,[{<<"phrases_custom">>,
        [{<<"id">>,<<"1">>}, 
         {<<"phrase">>,<<"The quick brown fox jumps over the lazy dog">>}],
     {<<"phrases_custom">>,
        [{<<"id">>,<<"5">>},
        {<<"phrase">>,<<"The quick brown fox jumps over the lazy dog">>}],
    0.0,2}
    %% Note the last two fields of the result are Max Score and Number Found.

Semi-compatible behavior by specifying the fl (with the exception of max score 
and number found):
riakc_pb_socket:search(Pid, <<"phrases_custom">>, <<"phrase:fox">>, 
[{fl,[<<"id">>]}], 5000, 5000).
{ok,[{<<"phrases_custom">>,[{<<"id">>,<<"1">>}]},
     {<<"phrases_custom">>,[{<<"id">>,<<"5">>}]},
    0.0,2}

Cheers -
Dave


_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to