From 3ef8cf322e69fd5176f94f7e78ff8f66fd2b5f87 Mon Sep 17 00:00:00 2001 From: OJ Date: Thu, 30 Aug 2012 19:48:08 +1000 Subject: [PATCH] Fix index look up with Riak 1.2 It appears that functionality of indexes in Riak 1.2 is a little different to earlier versions this change accommodates those changes. Thanks to Naoya Yamamoto for picking this up! --- apps/csd_core/src/csd_riak.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/csd_core/src/csd_riak.erl b/apps/csd_core/src/csd_riak.erl index 866d3b6..0cbcc5c 100644 --- a/apps/csd_core/src/csd_riak.erl +++ b/apps/csd_core/src/csd_riak.erl @@ -103,8 +103,8 @@ set_indexes(RiakObj, Indexes) -> get_index(RiakObj, Type, Name) -> Meta = riakc_obj:get_metadata(RiakObj), Indexes = dict:fetch(?INDEX_KEY, Meta), - IndexKey = binary_to_list(index(Type, Name)), - Value = proplists:get_value(IndexKey, Indexes), + IndexKey = index(Type, Name), + Value = binary_to_list(proplists:get_value(IndexKey, Indexes)), case Type of int -> list_to_integer(Value); bin -> Value