anchor.diff:      {reply, {ok, Results}, State};
   process_response(#request{msg = #rpbindexreq{stream=true, return_terms=Terms, return_body=Body}}=Request,
                    #rpbindexresp{results=Results, keys=Keys, done=Done, continuation=Cont}, State) ->
  -    ToSend = process_index_response(not just_keys(Terms, Body), Keys, Results),
  +    ToSend = process_index_response(response_type(Terms, Body), Keys, Results),
       _ = send_caller(ToSend, Request),
       DoneResponse = {reply, {done, Cont}, State},
       case Done of
  
positive.code:     %% this code works fine despite the backwards binding names
      Res = [{V, K} ||  #rpbpair{key=V, value=K} <- Results],
      ?INDEX_STREAM_RESULT{terms=Res};
  process_index_response(true, Keys, []) ->
      ?INDEX_STREAM_RESULT{keys=Keys}.
  
  -spec index_stream_result_to_index_result(index_stream_result()) ->
  
negative.code:     %% Unknown request/response combo
      {reply, {error, {unknown_response, Request, Reply}}, State}.
  
  %% Return `keys', `terms', or `objects' depending on the value of
  %% `return_terms' and `return_body'
  response_type(_, true) ->
      objects;
  response_type(true, false) ->
      terms;
  response_type(_, _) ->
      keys.
  
  
  %% Helper for index responses
  -spec process_index_response('keys'|'terms'|'objects', list(), list()) ->
      index_stream_result().
  process_index_response(keys, Keys, _) ->
      ?INDEX_STREAM_RESULT{keys=Keys};
  process_index_response(_, [], Results) ->
      %% If return_terms is true and return_body is false, rpbpair is
      %% abused to send Value,Key pairs as Key, Value pairs in a 2i
      %% query the 'key' is the index value and the 'value' the indexed
  