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:   Offset     :: non_neg_integer(),
    State      :: state(),
    Response   :: sumo_store:result([sumo_internal:doc()], state()).
  find_by(DocName, Conditions, SortFields, Limit, Offset, State) ->
    #state{conn = Conn, bucket = Bucket, index = Index, get_opts = Opts} = State,
    TranslatedConditions = transform_conditions(DocName, Conditions),
    Sort = build_sort(SortFields),
    Query = <<(build_query(TranslatedConditions))/binary>>,
    case search_keys_by(Conn, Index, Query, Sort, Limit, Offset) of
      {ok, {_Total, Keys}} ->
        Results = fetch_docs(DocName, Conn, Bucket, Keys, Opts),
        {ok, Results, State};
  
negative.code:   State      :: state(),
    Response   :: sumo_store:result([sumo_internal:doc()], state()).
  find_all(DocName, Sort, Limit, Offset, State) ->
    find_by(DocName, [], Sort, Limit, Offset, State).
  
  %% @doc
  