How to design schema for record search.

Yang Zhenguo yangzhenguo at gmail.com
Sun Aug 31 14:50:06 EDT 2014


Hi all,

I have a question on record search.

First, the value of my bucket is record.

#solution{
        user_id = LoginId,
        problem_id = ProblemId,
        language = Language
}.

Secondly, got riakc_obj
RSolution = riakc_obj:new(SolutionBucket, SolutionKey, Solution)

Finally,
riakc_pb_socket:put(ClientPid, RSolution1)

Howevery, I cant search it via the following command:
riakc_pb_socket:search(Pid, <<"sln_index">>, <<"language:*">>).

Any suggestion?

BTW, I can get the following result:
10> riakc_pb_socket:search(Pid, <<"sln_index">>, <<"*:*">>).
{ok,{search_results,[{<<"sln_index">>,
                      [{<<"score">>,<<"1.00000000000000000000e+00">>},
                       {<<"_yz_rb">>,<<"Solutions_a">>},
                       {<<"_yz_rt">>,<<"solution_t">>},
                       {<<"_yz_rk">>,<<"yang_20140901T02:38:17">>},
                       {<<"_yz_id">>,

<<"1*solution_t*Solutions_a*yang_20140901T02:38:17*48">>}]}],

Thanks in advance.

-- 
Zhenguo Yang
www.prinbit.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20140901/2bb8c343/attachment.html>


More information about the riak-users mailing list