anchor.diff:  
   url(BaseUrl, Params) ->
       BaseUrl#url { path = lists:concat([BaseUrl#url.path, Params]) }.
  -url(BaseUrl, KeyGen, Params) ->
  -    BaseUrl#url { path = lists:concat([BaseUrl#url.path, '/', KeyGen(), Params]) }.
  +url(BaseUrl, KeyGen, Params) when is_function(KeyGen) ->
  +    BaseUrl#url { path = lists:concat([BaseUrl#url.path, '/', KeyGen(), Params]) };
  +url(BaseUrl, Key, Params) ->
  +    BaseUrl#url { path = lists:concat([BaseUrl#url.path, '/', Key, Params]) }.
   
   search_url(BaseUrl, SolrPath, SearchGen) ->
  -    BaseUrl#url { path = lists:concat([SolrPath, '/select?', SearchGen()]) }.
  +    Params = if is_function(SearchGen) ->
  +                     SearchGen();
  +                true ->
  +                     SearchGen
  +             end,
  +    BaseUrl#url { path = lists:concat([SolrPath, '/select?', Params]) }.
   
   stat_url(BaseUrl) ->
       BaseUrl#url{path="/stats"}.
  
positive.code:     %% Setup client ID by base-64 encoding the ID
      ClientId = {'X-Riak-ClientId', base64:encode(<<Id:32/unsigned>>)},
      ?DEBUG("Client ID: ~p\n", [ClientId]),
  
      application:start(ibrowse),
  
  
negative.code: -record(state, { client_id,          % Tuple client ID for HTTP requests
                   base_urls,          % Tuple of #url -- one for each IP
                   base_urls_index,    % #url to use for next request
                   files,              % List of files to put
                   path_params,        % Params to append on the path
                   solr_path,          % SOLR path for searches
                   searchgen }).       % Search generator
  
  
  -define(NOT_EXPECTED(Qry, Expected, Actual),
          lists:flatten(io_lib:format("Query ~p expected ~p but got ~p",
                                      [Qry, Expected, Actual]))).
  
  
  %% ====================================================================
  