Florian,

Also if your value is a proplist and you use the content-type of
"application/x-erlang-binary", then Search will automatically extract the
values as it does for JSON and XML.  See
https://github.com/basho/riak_search/blob/master/src/riak_search_kv_erlang_extractor.erl

On Sun, Jun 24, 2012 at 6:11 AM, Erik Søe Sørensen <[email protected]> wrote:

> One answer is: dict:to_list/1 and dict:from_list may be your friends.
> Another is: Are you sure that dict is appropriate for your data? If the
> number of entries is bounded and does not exceed around a dozen, then a
> property list might be faster.
> (Although I'd advice you to use lists:keyfind(Key, 1, PropList) rather
> than proplist:get_value(); there's a significant speed difference.)
> Thirdly, you can of course translate to JSON and back, but keeping the
> data on Erlang term form is probably both simpler and faster.
>
> /Erik
>
> ________________________________________
> From: [email protected] [
> [email protected]] On Behalf Of Florian Odronitz [
> [email protected]]
> Sent: 23 June 2012 16:39
> To: [email protected]
> Subject: JSON-Encoding from riakc
>
> Hello List,
>
> I am using the riak-erlang-client and I am trying to store JSON. Now the
> riak_pb_kv_codec module assumes that when using the erlang client one would
> always like to encode data in erlang binaries. Which is ok with me _until_
> riak_search needs to index this data.
> I know the indexing also works on erlang data but only until one uses
> proplists. But I use dicts in all my data structures...
> Any ideas about how to best proceed?
>
> Thanks,
> Florian
> _______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
> _______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>



-- 
Sean Cribbs <[email protected]>
Software Engineer
Basho Technologies, Inc.
http://basho.com/
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to