Skip to content

Commit

Permalink
Fix index look up with Riak 1.2
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
OJ committed Aug 30, 2012
1 parent d27ffd7 commit 3ef8cf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/csd_core/src/csd_riak.erl
Expand Up @@ -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
Expand Down

0 comments on commit 3ef8cf3

Please sign in to comment.