anchor.diff:  
   -type index() :: binary().
   -type docid() :: binary().
  +-type idxdoc() :: tuple(). % #riak_indexed_doc{}
   
   -type search_fields() :: [{search_field(),search_data()}].
   -type search_field() :: string().
  
positive.code:     end.
  
  %% Make an indexed document under Index/DocId from the RiakObject
  -spec make_indexed_doc(index(), docid(), riak_object(), extractdef()) -> ok.
  make_indexed_doc(Index, DocId, RiakObject, Extractor) ->
      Fields = run_extract(RiakObject, Extractor),
      IdxDoc0 = riak_indexed_doc:new(DocId, Fields, [], Index),
      {ok, IdxDoc} = riak_indexed_doc:analyze(IdxDoc0),
      IdxDoc.
                           
  -spec make_index(riak_object()) -> binary().
  make_index(RiakObject) ->
      riak_object:bucket(RiakObject).
  
negative.code: validate_funterm(FunTerm) ->
      throw({"cannot parse funterm", FunTerm}).
  
  %% Decode a bucket property that was set using JSON/HTTP interface
  erlify_json_funterm(<<"erlang">>, Props) ->
      Mod = to_modfun(proplists:get_value(<<"module">>, Props, undefined)),
      Fun = to_modfun(proplists:get_value(<<"function">>, Props, undefined)),
      Arg = proplists:get_value(<<"arg">>, Props, undefined),
      {{modfun, Mod, Fun}, Arg};
  erlify_json_funterm(<<"javascript">>, Props) ->
      Source = proplists:get_value(<<"source">>, Props, undefined),
      Name = proplists:get_value(<<"name">>, Props, undefined),
      Arg = proplists:get_value(<<"arg">>, Props, undefined),
      case Source of
          undefined ->
              case Name of
                  undefined ->
                      throw("javascript kv/search extractor must have name or source");
                  _ ->
                      {{jsfun, Name}, Arg}
              end;
          _ ->
              {{jsanon, Source}, Arg}
      end;
  erlify_json_funterm(Lang, _Props) ->
      throw({"kv/search extractors must be written in erlang or javascript", Lang}).
  
       
  
  -spec to_modfun(list() | atom()) -> atom().
  to_modfun(List) when is_list(List) ->
      %% Using list_to_atom here so that the extractor module
  