Hello Hao,

Riak object values must be supplied to Riak as binary, are you attempting
to store the proplist using term_to_binary/1? If so, you would need to
create a custom search extractor for your values. Here is a small tutorial
on creating extractors for yokozuna:
http://docs.basho.com/riak/latest/dev/search/custom-extractors/

If you don't require the value to be specifically a proplist, a simpler
solution would be to convert your proplist to JSON which already has an
extractor built into RIak Search. A good module for JSON encoding /
decoding is mochijson2 which comes with the
https://github.com/mochi/mochiweb repo.

> SimpleProplist = [{key1, <<"value1">>}, {key2, <<"value2">>}].
...
> mochijson2:encode(SimpleProplist).
...
> RiakObjectValue =
list_to_binary(lists:flatten(mochijson2:encode(SimpleProplist))).
<<"{\"key1\":\"value1\",\"key2\":\"value2\"}">>

Cheers!
Drew

On Sat, Aug 8, 2015 at 2:06 AM Hao <[email protected]> wrote:

> If I want to save Erlang proplist into Riak and use Riak Search 2.0, do I
> need to create a Erlang Proplist extractor for solr to be able to index it?
>
> --
> Hao
>
>
> _______________________________________________
> 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

Reply via email to