anchor.diff:              IdxDoc2 = riak_indexed_doc:set_fields([
                   {"payload", binary_to_list(Bytes)}], IdxDoc),
               %% index
  -            ok = SearchClient:index_doc(AnalyzerPid, IdxDoc2);
  +            SearchClient:index_doc(AnalyzerPid, IdxDoc2);
           {error, eisdir} ->
               io:format("following directory: ~p~n", [File]),
  -            index_dir(SearchClient, AnalyzerPid, File, Index, Field);
  +            index_dir(File, Index, Field);
           Err ->
               io:format("index_file(~p, ~p, ~p): error: ~p~n",
                   [File, Index, Field, Err])
  
positive.code: 
  %% Full-text index the files within the specified directory.
  index_dir(Directory) ->
      {ok, Pid} = qilr_analyzer_sup:new_analyzer(),
      {ok, SearchClient} = riak_search:local_client(),
      Result = index_dir(SearchClient, Pid, Directory, ?DEFAULT_INDEX, ?DEFAULT_FIELD),
      qilr_analyzer:close(Pid),
      Result.
  
  index_dir(SearchClient, AnalyzerPid, Directory, Index, Field) ->
      io:format(" :: Indexing directory: ~s~n", [Directory]),
  
      %% Get a list of files in the directory, and index them.
      Directory1 = case string:str(Directory, "*") of
          0 -> filename:join([Directory, "*"]);
  
negative.code:     Files = filelib:wildcard(Directory1),
      io:format(" :: Found ~p files...~n", [length(Files)]),
  %%    [index_file(SearchClient, File, Index, Field) || File <- Files],
       plists:map(fun(File) -> index_file(AnalyzerPid, File, Index, Field) end,
           Files, {processes, 32}),
      qilr_analyzer:close(AnalyzerPid),
      ok.
  
  %% %% Full-text index the specified file.
  %% index_file(SearchClient, File) ->
  %%     index_file(SearchClient, File, ?DEFAULT_INDEX, ?DEFAULT_FIELD).
  index_file(AnalyzerPid, File, Index, Field) ->
  %%     Props = random_properties(),
      Basename = filename:basename(File),
      io:format(" :: Indexing file: ~s~n", [Basename]),
      {ok, SearchClient} = riak_search:local_client(),
      case file:read_file(File) of
          {ok, Bytes} ->
              %% build doc
  