anchor.diff:      {reply, {ok, []}, State};
   process_response(#request{msg = #rpbindexreq{stream=true, return_terms=Terms}}=Request,
                    #rpbindexresp{results=Results, keys=Keys, done=Done, continuation=Cont}, State) ->
  -    ToSend = case {Terms, Results, Keys} of
  -                 {_, undefined, undefined} -> ok;
  -                 {true, Res0, _} ->
  -                     %% 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 objects primary key
  -                     Res = [{V, K} ||  #rpbpair{key=V, value=K} <- Res0],
  -                     {results, Res};
  -                 {undefined, _, Res} ->
  -                     {keys, Res}
  -             end,
  -
  +    ToSend = process_index_response(Terms, Keys, Results),
       case Cont of
           undefined -> send_caller(ToSend, Request);
           _ -> send_caller([ToSend, {continuation, Cont}], Request)
  
positive.code: process_response(Request, Reply, State) ->
      %% Unknown request/response combo
      {reply, {error, {unknown_response, Request, Reply}}, State}.
  
  %%
  %% Called after sending a message - supports returning a
  
negative.code:                 _ -> {pending, State}
              end,
      Reply;
  process_response(#request{msg = #rpbindexreq{return_terms=Terms}}, #rpbindexresp{results=Results, keys=Keys, continuation=undefined}, State) ->
      Response = process_index_response(Terms, Keys, Results),
      {reply, {ok, Response}, State};
  process_response(#request{msg = #rpbindexreq{return_terms=Terms}}, #rpbindexresp{results=Results, keys=Keys, continuation=Cont}, State) ->
      Response = process_index_response(Terms, Keys, Results),
      {reply, {ok, [Response, {continuation, Cont}]}, State};
  process_response(#request{msg = #rpbsearchqueryreq{}}, prbsearchqueryresp, State) ->
      {reply, {error, notfound}, State};
  process_response(#request{msg = #rpbsearchqueryreq{index=Index}},
                   #rpbsearchqueryresp{docs=PBDocs,max_score=MaxScore,
  