anchor.diff:      Opts = riak_index:add_timeout_opt(Timeout, [{max_results, MaxResults}]),
   
       {ok, ReqID} =  Client:stream_get_index(Bucket, Query, Opts),
  -    StreamFun = index_stream_helper(ReqID, Boundary, ReturnTerms, MaxResults, undefined, 0),
  +    StreamFun = index_stream_helper(ReqID, Boundary, ReturnTerms, MaxResults, proplists:get_value(timeout, Opts), undefined, 0),
       {{stream, {<<>>, StreamFun}}, CTypeRD, Ctx}.
   
  -index_stream_helper(ReqID, Boundary, ReturnTerms, MaxResults, LastResult, Count) ->
  +index_stream_helper(ReqID, Boundary, ReturnTerms, MaxResults, Timeout, LastResult, Count) ->
       fun() ->
               receive
                   {ReqID, done} ->
  
positive.code:                     LastResult1 = last_result(Results),
                      Count1 = Count + length(Results),
                      {iolist_to_binary(Body),
                       index_stream_helper(ReqID, Boundary, ReturnTerms, MaxResults, LastResult1, Count1)};
                  {ReqID, Error} ->
                      lager:error("Error in index wm: ~p", [Error]),
                      ErrorJson = mochijson2:encode({struct, [{error, Error}]}),
                      Body = ["\r\n--", Boundary, "\r\n",
                              "Content-Type: application/json\r\n\r\n",
                              ErrorJson,
                              "\r\n--", Boundary, "--\r\n"],
                      {iolist_to_binary(Body), done}
              after 60000 ->
                      {error, timeout}
              end
      end.
  
  handle_all_in_memory_index_query(RD, Ctx) ->
      Client = Ctx#ctx.client,
  
negative.code:                             end,
                      {iolist_to_binary(Final), done};
                  {ReqID, {results, []}} ->
                      {<<>>, index_stream_helper(ReqID, Boundary, ReturnTerms, MaxResults, Timeout, LastResult, Count)};
                  {ReqID, {results, Results}} ->
                      %% JSONify the results
                      JsonResults = encode_results(ReturnTerms, Results),
  