anchor.diff:  			   proplists:get_value(<<"_yz_rk">>, X)
   		   end, KeysExt)}.
   
  +get_keys(Conn, [], Bucket, Max, Skip, Sort) ->
  +  {ok, {search_results, KeysExt, _, _}} = riakc_pb_socket:search(
  +    Conn, list_to_binary(Bucket), list_to_binary("_yz_id:*"), [{rows, Max}, {start, Skip}, {sort, Sort}]),
  +  {ok, lists:map(fun ({_,X}) ->
  +    proplists:get_value(<<"_yz_rk">>, X)
  +  end, KeysExt)};
  +get_keys(Conn, Conditions, Bucket, Max, Skip, Sort) ->
  +  {ok, {search_results, KeysExt, _, _}} = riakc_pb_socket:search(
  +    Conn, list_to_binary(Bucket), list_to_binary(build_search_query(Conditions)), [{rows, Max}, {start, Skip}, {sort, Sort}]),
  +  {ok, lists:map(fun ({_,X}) ->
  +    proplists:get_value(<<"_yz_rk">>, X)
  +  end, KeysExt)}.
   
   % this is a stub just to make the tests runable
   count(Conn, Type, Conditions) ->
  -    length(find(Conn, Type, Conditions, all, 0, 0, 0)).
  +    length(find(Conn, Type, Conditions, all, 0, id, ascending)).
   
   counter(_Conn, _Id) ->
       {error, notimplemented}.
  
positive.code: % this is a stub just to make the tests runable
  find(Conn, Type, Conditions, Max, Skip, Sort, SortOrder) ->
      Bucket = type_to_bucket_name(Type), % return bucket name into list type
      {ok, Keys} = get_keys(Conn, Conditions, Bucket),
      Records = find_acc(Conn, atom_to_list(Type), Keys, []),
      Sorted = if
          is_atom(Sort) ->
              lists:sort(fun (A, B) ->
                          case SortOrder of
                              ascending  -> A:Sort() =< B:Sort();
                              descending -> A:Sort() > B:Sort()
                          end
                  end,
                  Records);
          true -> Records
      end,
      case Max of
          all -> lists:nthtail(Skip, Sorted);
          Max when Skip < length(Sorted) ->
              lists:sublist(Sorted, Skip + 1, Max);
          _ ->
              []
      end.
  
  get_keys(Conn, [], Bucket) ->
      riakc_pb_socket:list_keys(Conn, Bucket);
  
negative.code:         lists:all(fun({_, _}) -> true;
              (_)      -> false
          end,
          List).
  
  
  build_options_query([], OptionsList) ->
    OptionsList;
  build_options_query([{limit, Val}|Tail], OptionsList) ->
    build_options_query(Tail, lists:append(OptionsList, [{rows, Val}])).