anchor.diff:  %% Search all docs that match with the given query, but only keys are returned.
   %% IMPORTANT: assumes that default schema 'yokozuna' is being used.
   %% @end
  -search_keys_by(Conn, Index, Query, Sort, Limit, Offset) ->
  -  case sumo_store_riak:search(Conn, Index, Query, Sort, Limit, Offset) of
  +search_keys_by(Conn, Index, Query, SortOpts, Limit, Offset) ->
  +  case sumo_store_riak:search(Conn, Index, Query, SortOpts, Limit, Offset) of
       {ok, {search_results, Results, _, Total}} ->
         Keys = lists:foldl(fun({_, KV}, Acc) ->
           {_, K} = lists:keyfind(<<"_yz_rk">>, 1, KV),
  
positive.code:   State      :: state(),
    Response   :: sumo_store:result([sumo_internal:doc()], state()).
  find_all(DocName, Sort, Limit, Offset, State) ->
    %% @todo implement search with sort parameters.
    find_by(DocName, [], Sort, Limit, Offset, State).
  
  %% @doc
  
negative.code: -spec search(
    connection(), index(), binary(), list(), non_neg_integer(), non_neg_integer()
  ) -> {ok, search_result()} | {error, term()}.
  search(Conn, Index, Query, SortOpts, 0, 0) ->
    riakc_pb_socket:search(Conn, Index, Query, SortOpts);
  search(Conn, Index, Query, SortOpts, Limit, Offset) ->
    riakc_pb_socket:search(Conn, Index, Query, [{start, Offset}, {rows, Limit}] ++ SortOpts).
  
  -spec build_query(sumo:conditions()) -> binary().
  build_query(Conditions) ->
  