anchor.diff:  
       %% If all ok, remove the old entries and index the new
       remove_old_entries(RiakClient, SearchClient, Index, DocId),
  -    Postings = riak_indexed_doc:postings(NewIdxDoc),
  -    SearchClient:index_terms(Postings),
  -
  -    %% Store the indexed_doc for next time
  -    riak_indexed_doc:put(RiakClient, NewIdxDoc),
  -    ok.
  +
  +    case NewIdxDoc of
  +        deleted ->
  +            riak_indexed_doc:delete(RiakClient, Index, DocId);
  +        _ ->
  +            %% Update the search index and store the indexed_doc in k/v
  +            Postings = riak_indexed_doc:postings(NewIdxDoc),
  +            SearchClient:index_terms(Postings),
  +            riak_indexed_doc:put(RiakClient, NewIdxDoc)
  +    end.
   
   %% Remove any old index entries if they exist
   -spec remove_old_entries(riak_client(), search_client(), index(), docid()) -> ok.
  
positive.code:                          {user_funterm(), args()}) -> {funterm(), args()}.
  validate_extractor(undefined) ->
      {?DEFAULT_EXTRACTOR, ?DEFAULT_ARGS};
  validate_extractor({FunTerm, Args}) when is_tuple(FunTerm) ->
      {validate_funterm(FunTerm), Args};
  validate_extractor(FunTerm) ->
  
negative.code: 
  -type index() :: binary().
  -type docid() :: binary().
  -type idxdoc() :: tuple(). % #riak_indexed_doc{}
  
  -type search_fields() :: [{search_field(),search_data()}].
  -type search_field() :: string().
  