anchor.diff:          {ok, Res} ->
               Value = riakc_obj:get_value(Res),
               Data = binary_to_term(Value),
  +            ConvertedData = riak_search_decode_data(Data),
               AttributeTypes = boss_record_lib:attribute_types(Type),
  -            ConvertedData = decode_data_from_riak(Data, AttributeTypes),
               Record = apply(Type, new, lists:map(fun (AttrName) ->
                               Val = proplists:get_value(AttrName, ConvertedData),
                               AttrType = proplists:get_value(AttrName, AttributeTypes),
  
positive.code:     BinKey = list_to_binary(Key),
      ok = case riakc_pb_socket:get(Conn, Bucket, BinKey) of
          {ok, O} ->
              O2 = riakc_obj:update_value(O, ConvertedPropList),
              riakc_pb_socket:put(Conn, O2);
          {error, _} ->
              O = riakc_obj:new(Bucket, BinKey, ConvertedPropList, <<"application/x-erlang-term">>),
              riakc_pb_socket:put(Conn, O)
      end,
      {ok, Record:set(id, lists:concat([Type, "-", Key]))}.
  
negative.code: escape_value([H|T], Acc) ->
      escape_value(T, [H|Acc]).
  
  riak_search_encode_key(K) ->
      list_to_binary(atom_to_list(K)).
  
  riak_search_encode_value(V) when is_list(V) ->
      list_to_binary(V);
  riak_search_encode_value(V) ->
      V.
  
  riak_search_decode_data(Data) ->
      lists:map(fun({K, V}) ->
          DecodedKey = riak_search_decode_key(K),
          DecodedValue = riak_search_decode_value(V),
          {DecodedKey, DecodedValue}
      end, Data).
  
  riak_search_decode_key(K) ->
      list_to_atom(binary_to_list(K)).
  
  riak_search_decode_value(V) when is_binary(V) ->
      binary_to_list(V);
  riak_search_decode_value(V) ->
      V.
  