riak-erlang-client search changes

Dave Parfitt dparfitt at basho.com
Thu Aug 2 11:14:29 EDT 2012

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">>).                

Proposed behavior:
riakc_pb_socket:search(Pid, <<"phrases_custom">>, <<"phrase:fox">>).
         {<<"phrase">>,<<"The quick brown fox jumps over the lazy dog">>}],
        {<<"phrase">>,<<"The quick brown fox jumps over the lazy dog">>}],
    %% 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).

Cheers -

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120802/ece62982/attachment.html>

More information about the riak-users mailing list