anchor.diff:  -record(ctx, {
             client,       %% riak_client() - the store client
             riak,         %% local | {node(), atom()} - params for riak client
  +          bucket_type,  %% Bucket type (from uri)
             bucket,       %% The bucket to query.
             index_query,   %% The query..
             max_results :: all | pos_integer(), %% maximum number of 2i results to return, the page size.
  
positive.code: %% @doc Initialize this resource.
  init(Props) ->
      {ok, #ctx{
         riak=proplists:get_value(riak, Props)
        }}.
  
  
  
negative.code: %%          {boolean(), reqdata(), context()}
  %% @doc Determine whether or not a connection to Riak
  %%      can be established. Also, extract query params.
  service_available(RD, Ctx0=#ctx{riak=RiakProps}) ->
      Ctx = riak_kv_wm_utils:ensure_bucket_type(RD, Ctx0, #ctx.bucket_type),
      case riak_kv_wm_utils:get_riak_client(RiakProps, riak_kv_wm_utils:get_client_id(RD)) of
          {ok, C} ->
              {true, RD, Ctx#ctx { client=C }};
  