anchor.diff:  
   %% This method returns fake properties. It is called by index_file and
   %% is here so that you can play around with facet search.
  -random_properties() ->
  -    Colors = ["red", "orange", "yellow", "green", "blue"],
  -    ColorNum = random:uniform(length(Colors)),
  -    Color = lists:nth(ColorNum, Colors),
  -
  -    Directions = ["north", "south", "east", "west"],
  -    DirectionNum = random:uniform(length(Directions)),
  -    Direction = lists:nth(DirectionNum, Directions),
  -
  -    [{"color", Color}, {"direction", Direction}].
  -
  -
  -bytes_to_words(B) ->
  -    bytes_to_words(B, []).
  -bytes_to_words(<<>>, []) ->
  -    [];
  -bytes_to_words(<<>>, Acc) ->
  -    Word = string:to_lower(lists:reverse(Acc)),
  -    [Word];
  -bytes_to_words(<<C, Rest/binary>>, Acc) when ?IS_CHAR(C) ->
  -    bytes_to_words(Rest, [C|Acc]);
  -bytes_to_words(<<_, Rest/binary>>, []) ->
  -    bytes_to_words(Rest, []);
  -bytes_to_words(<<_, Rest/binary>>, Acc) ->
  -    Word = string:to_lower(lists:reverse(Acc)),
  -    [Word|bytes_to_words(Rest, [])].
  -
  +%% random_properties() ->
  +%%     Colors = ["red", "orange", "yellow", "green", "blue"],
  +%%     ColorNum = random:uniform(length(Colors)),
  +%%     Color = lists:nth(ColorNum, Colors),
  +
  +%%     Directions = ["north", "south", "east", "west"],
  +%%     DirectionNum = random:uniform(length(Directions)),
  +%%     Direction = lists:nth(DirectionNum, Directions),
  +
  +%%     [{"color", Color}, {"direction", Direction}].
  +
  +
  +%% bytes_to_words(B) ->
  +%%     bytes_to_words(B, []).
  +%% bytes_to_words(<<>>, []) ->
  +%%     [];
  +%% bytes_to_words(<<>>, Acc) ->
  +%%     Word = string:to_lower(lists:reverse(Acc)),
  +%%     [Word];
  +%% bytes_to_words(<<C, Rest/binary>>, Acc) when ?IS_CHAR(C) ->
  +%%     bytes_to_words(Rest, [C|Acc]);
  +%% bytes_to_words(<<_, Rest/binary>>, []) ->
  +%%     bytes_to_words(Rest, []);
  +%% bytes_to_words(<<_, Rest/binary>>, Acc) ->
  +%%     Word = string:to_lower(lists:reverse(Acc)),
  +%%     [Word|bytes_to_words(Rest, [])].
  +
  +random_indexer(Pool) ->
  +    lists:nth(random:uniform(length(Pool)), Pool).
  +
  +indexer() ->
  +    {ok, Pid} = qilr_analyzer_sup:new_analyzer(),
  +    {ok, Client} = riak_search:local_client(),
  +    do_index(Pid, Client).
  +
  +do_index(AnalyzerPid, SearchClient) ->
  +    receive
  +        {index, Doc} ->
  +            SearchClient:index_doc(AnalyzerPid, Doc),
  +            do_index(AnalyzerPid, SearchClient);
  +        stop ->
  +            io:format("(~p) indexer complete~n", [self()]),
  +            ok
  +    end.
   
   %% NOTE: This was used during early testing against a demo
   %% backend. Keeping it around for a little while longer.
  
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:             IdxDoc2 = riak_indexed_doc:set_fields([
                  {"payload", binary_to_list(Bytes)}], IdxDoc),
              %% index
              SearchClient:index_doc(AnalyzerPid, IdxDoc2);
          {error, eisdir} ->
              io:format("following directory: ~p~n", [File]),
              index_dir(File, Index, Field);
          Err ->
              io:format("index_file(~p, ~p, ~p): error: ~p~n",
                  [File, Index, Field, Err])
  