>
> Index via the erlang client (error)
>
> ===================================
>
> Eshell V5.9.2 (abort with ^G)
> 1> {ok, Conn} = riakc_pb_socket:start_link("localhost", 8087).
> {ok,<0.34.0>}
> 2> Body = <<"{\"name_s\":\"tom\"}">>.
> <<"{\"name_s\":\"tom\"}">>
> 3> Object2Store =
> riakc_obj:new({<<"testtype">>,<<"somebucket">>},<<"00001">>,Body).
>
> {riakc_obj,{<<"testtype">>,<<"somebucket">>},
> <<"00002">>,undefined,[],undefined,
> <<"{\"name_s\":\"tom\"}">>}
> 4> ok = riakc_pb_socket:put(Conn,Object2Store).
> ok
>
> The object is stored (in riak), but not indexed (in solr):
> $ curl "http://localhost:8098/types/testtype/buckets/somebucket/keys/
> 00001"
> {"name_s":"tom"}
>
> ==> /../riak-yokozuna-0.14.0-src/rel/riak/log/console.log <==
> 2014-03-31 16:26:11.568 [error] <0.1448.0>@yz_kv:index:204 failed to
> index object {{<<"testtype">>,<<"somebucket">>},<<"00001">>} with error
> badarg because
> [{dict,fetch,[<<"content-type">>,{dict,4,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[],[],[],[],[[<<"dot">>|{<<35,9,254,249,83,57,16,45>>,{1,63563491571}}]],[],[],[],[],[],[[<<"X-Riak-VTag">>,53,117,84,48,117,57,84,88,70,88,98,79,53,77,77,76,103,67,102,55,100,74]],[[<<"index">>]],[],[[<<"X-Riak-Last-Modified">>|{1396,272371,362491}]],[],[]}}}],[{file,"dict.erl"},{line,125}]},{yz_doc,extract_fields,1,[{file,"src/yz_doc.erl"},{line,99}]},{yz_doc,make_doc,5,[{file,"src/yz_doc.erl"},{line,71}]},{yz_doc,'-make_docs/4-lc$^0/1-0-',5,[{file,"src/yz_doc.erl"},{line,60}]},{yz_kv,index,7,[{file,"src/yz_kv.erl"},{line,249}]},{yz_kv,index,3,[{file,"src/yz_kv.erl"},{line,191}]},{riak_kv_vnode,actual_put,6,[{file,"src/riak_kv_vnode.erl"},{line,1391}]},{riak_kv_vnode,perform_put,3,[{file,"src/riak_kv_vnode.erl"},{line,1380}]}]
>
You failed to provide a content-type when building the object. It's
not easy to see if you aren't used to Erlang but the error in the log
shows a failure to find the key <<"content-type">> in the object's
metadata.
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com