anchor.diff:    Offset     :: non_neg_integer(),
     State      :: state(),
     Response   :: sumo_store:result([sumo_internal:doc()], state()).
  -find_by(DocName, Conditions, SortFields, Limit, Offset, State) ->
  +find_by(DocName, Conditions, Sort, Limit, Offset, State) ->
     #state{conn = Conn, bucket = Bucket, index = Index, get_opts = Opts} = State,
     TranslatedConditions = transform_conditions(DocName, Conditions),
  -  Sort = build_sort(SortFields),
  +  SortOpts = build_sort(Sort),
     Query = <<(build_query(TranslatedConditions))/binary>>,
  -  case search_keys_by(Conn, Index, Query, Sort, Limit, Offset) of
  +  case search_keys_by(Conn, Index, Query, SortOpts, Limit, Offset) of
       {ok, {_Total, Keys}} ->
         Results = fetch_docs(DocName, Conn, Bucket, Keys, Opts),
         {ok, Results, State};
  
positive.code: -spec search(
    connection(), index(), binary(), list(), non_neg_integer(), non_neg_integer()
  ) -> {ok, search_result()} | {error, term()}.
  search(Conn, Index, Query, Sorts, 0, 0) ->
    riakc_pb_socket:search(Conn, Index, Query, Sorts);
  search(Conn, Index, Query, Sorts, Limit, Offset) ->
    riakc_pb_socket:search(Conn, Index, Query, [{start, Offset}, {rows, Limit}] ++ Sorts).
  
  -spec build_query(sumo:conditions()) -> binary().
  build_query(Conditions) ->
  
negative.code: %% 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, 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),
  