Anynone may help me? Thanks a lot<br><br><div class="gmail_quote">2012/10/10 郎咸武 <span dir="ltr"><<a href="mailto:langxianzhe@gmail.com" target="_blank">langxianzhe@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Hi guys, </div><div>I need your help.</div><div><br></div><div>My question is that i can not search utf8 format data using riak search.</div><br clear="all"><div><u>1)The attribute of bucket is in the following</u></div>

<div><div>(<a href="mailto:riak@127.0.0.1" target="_blank">riak@127.0.0.1</a>)8> C:get_bucket(<<"user1">>). </div><div>[{search,true},</div><div> {allow_mult,false},</div><div> {basic_quorum,false},</div>
<div> {big_vclock,50},</div>
<div> {chash_keyfun,{riak_core_util,chash_std_keyfun}},</div><div> {dw,quorum},</div><div> {last_write_wins,false},</div><div> {linkfun,{modfun,riak_kv_wm_link_walker,mapreduce_linkfun}},</div><div> {n_val,3},</div><div>
 {name,<<"user1">>},</div>
<div> {notfound_ok,true},</div><div> {old_vclock,86400},</div><div> {postcommit,[]},</div><div> {pr,0},</div><div> {precommit,[{struct,[{<<"mod">>,<<"riak_search_kv_hook">>},</div>

<div>                      {<<"fun">>,<<"precommit">>}]}]},</div><div> {pw,0},</div><div> {r,quorum},</div><div> {rw,quorum},</div><div> {small_vclock,50},</div><div> {w,quorum},</div>

<div> {young_vclock,20}]</div></div><div><br></div><div><u>2)To put a Object to <<"user1">> bucket. The data is utf8 format.</u></div><div><br></div><div><div>(trends@jason-lxw)123> f(O), O=riakc_obj:new(<<"user1">>, <<"jason5">>,list_to_binary(mochijson:encode({struct, [{name, binary_to_list(unicode:characters_to_binary("爱"))},{sex,"male"}]})), "application/json").</div>

<div>{riakc_obj,<<"user1">>,<<"jason5">>,undefined,[],</div><div>           {dict,1,16,16,8,80,48,</div><div>                 {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},</div>

<div>                 {{[],[],[],[],[],[],[],[],[],[],[[<<...>>|...]],[],[],...}}},</div><div>           <<"{\"name\":\"\\u00e7\\u0088\\u00b1\",\"sex\":\"male\"}">>}</div>

<div>(((trends@jason-lxw)124> riakc_pb_socket:put(Pid, O).                                                                                                 ok                                                           </div>

</div><div><br></div><div><u>3)Using riak search query data</u></div><div><br></div><div><div>(ejabberd@meta)120>  riakc_pb_socket:search(Pid, <<"user1">>, list_to_binary("sex:mal*")).              There are not any problem.</div>

<div>{ok,{search_results,[{<<"user1">>,</div><div>                      [{<<"id">>,<<"jason">>},</div><div>                       {<<"name">>,<<"jason">>},</div>

<div>                       {<<"sex">>,<<"male">>}]},</div><div>                     {<<"user1">>,</div><div>                      [{<<"id">>,<<"jason1">>},</div>

<div>                       {<<"name">>,<<"jasdfsdf">>},</div><div>                       {<<"sex">>,<<"male">>}]},</div><div>                     {<<"user1">>,</div>

<div>                      [{<<"id">>,<<"jason2">>},</div><div>                       {<<"name">>,<<195,167,194,142,194,176>>},</div><div>                       {<<"sex">>,<<"male">>}]},</div>

<div>                     {<<"user1">>,</div><div>                      [{<<"id">>,<<"jason3">>},</div><div>                       {<<"name">>,<<195,167,194,136,194,177>>},</div>

<div>                       {<<"sex">>,<<"male">>}]},</div><div>                     {<<"user1">>,</div><div>                      [{<<"id">>,<<"jason5">>},</div>

<div>                       {<<"name">>,<<195,167,194,136,194,177>>},</div><div>                       {<<"sex">>,<<"male">>}]}],</div><div>                    0.0,5}}</div>

</div><div><div>(ejabberd@meta)121>  </div><div>(ejabberd@meta)121>  riakc_pb_socket:search(Pid, <<"user1">>, list_to_binary("name:jason*")).  </div><div>{ok,{search_results,[{<<"user1">>,</div>

<div>                      [{<<"id">>,<<"jason">>},</div><div>                       {<<"name">>,<<"jason">>},</div><div>                       {<<"sex">>,<<"male">>}]}],</div>

<div>                    0.0,1}}</div><div>(ejabberd@meta)122>  </div></div><div><br></div><div><br></div><div><div>(ejabberd@meta)123> <b>  But , The result is empty.</b></div><div>(ejabberd@meta)123>  riakc_pb_socket:search(Pid, <<"user1">>, list_to_binary("name:\"\\u00e7\\u0088\\u00b1\"")).  </div>

<div>{ok,{search_results,[],0.0,0}}</div></div><div><br></div><div>Thanks in advance.</div><div><br></div><div>Jason</div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div>-- <br>只为成功找方法,不为失败找理由<br>

</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>只为成功找方法,不为失败找理由<br>