anchor.diff:      HistTableName = atom_history_alias(Channel),
       [Key1, Key2, LText, HistTableName].
   
  --spec search_deleted(ddEntityId(), binary(), binary(), binary(), binary()) -> list().
  -search_deleted(_User, Channel, Text, CKey1, CKey2) ->
  +-spec search_deleted(ddEntityId(), binary(), binary(), binary(), binary(), boolean()) -> list().
  +search_deleted(_User, Channel, Text, CKey1, CKey2, DelStatus) ->
       [Key1, Key2, LText, HistTableName] = search_deleted_init(CKey1, CKey2, Text, Channel),
  -    SearchFun = fun() -> find_deleted(HistTableName, imem_meta:next(HistTableName, Key1), Key2, LText) end,
  +    SearchFun = fun() -> find_deleted(HistTableName, imem_meta:next(HistTableName, Key1), Key2, LText, DelStatus) end,
       imem_meta:return_atomic_list(imem_meta:transaction(SearchFun)).
   
  --spec find_deleted(atom(), binary(), binary(), binary()) -> list().
  -find_deleted(Table, Key, EndKey, Text) ->
  -    find_deleted(Table, Key, EndKey, Text, []).
  -
  --spec find_deleted(atom(), binary(), binary(), binary(), list()) -> list().
  -find_deleted(_Table, Key , EndKey, _Text, Acc) when Key > EndKey -> Acc;
  -find_deleted(_Table, '$end_of_table' , _EndKey, _Text, Acc)  -> Acc;
  -find_deleted(Table, Key , EndKey, <<>>, Acc) ->
  +-spec find_deleted(atom(), binary(), binary(), binary(), boolean()) -> list().
  +find_deleted(Table, Key, EndKey, Text, DelStatus) ->
  +    find_deleted(Table, Key, EndKey, Text, DelStatus, length(binterm_to_term_key(Key)) + 1, []).
  +
  +-spec find_deleted(atom(), binary(), binary(), binary(), boolean(), integer(), list()) -> list().
  +find_deleted(_Table, Key , EndKey, _Text, _DelStatus, _Len, Acc) when Key > EndKey -> Acc;
  +find_deleted(_Table, '$end_of_table' , _EndKey, _Text, _DelStatus, _Len, Acc)  -> Acc;
  +find_deleted(Table, Key , EndKey, <<>>, true, Len, Acc) ->
       NewAcc =  case imem_meta:read(Table, Key) of
           [#skvhHist{cvhist = [#skvhCL{ovalue = Value, nvalue = undefined}| _]}] ->
               Acc ++ [{binterm_to_term_key(Key), Value}];
           _ ->
               Acc
       end,
  -    find_deleted(Table, imem_meta:next(Table, Key), EndKey, <<>>, NewAcc);
  -find_deleted(Table, Key, EndKey, Text, Acc) ->
  +    NextKey = find_deleted_next(Table, imem_meta:next(Table, Key), EndKey, Len),
  +    find_deleted(Table, NextKey, EndKey, <<>>, true, Len, NewAcc);
  +find_deleted(Table, Key , EndKey, <<>>, false, Len, Acc) ->
  +    NewAcc =  case imem_meta:read(Table, Key) of
  +        [#skvhHist{cvhist = [#skvhCL{nvalue = Value}| _]}] ->
  +            Acc ++ [{binterm_to_term_key(Key), Value}];
  +        _ ->
  +            Acc
  +    end,
  +    NextKey = find_deleted_next(Table, imem_meta:next(Table, Key), EndKey, Len),
  +    find_deleted(Table, NextKey, EndKey, <<>>, false, Len, NewAcc);
  +find_deleted(Table, Key, EndKey, Text, true, Len, Acc) ->
       NewAcc =  case imem_meta:read(Table, Key) of
           [#skvhHist{cvhist = [#skvhCL{ovalue = Value, nvalue = undefined}| _]}] ->
               [LValue] = imem_index:vnf_lcase_ascii(Value),
  
positive.code:         _ ->
              Acc
      end,
      find_deleted(Table, imem_meta:next(Table, Key), EndKey, Text, NewAcc).
  
  -spec search_deleted_clients(ddEntityId(), binary(), binary(), binary(), binary(), integer()) -> list().
  search_deleted_clients(_User, Channel, Text, CKey1, CKey2, Limit) ->
      [Key1, Key2, LText, HistTableName] = search_deleted_init(CKey1, CKey2, Text, Channel),
  
negative.code:         , audit_readGT/4    %% (User, Channel, TS1, Limit)          read audit info after Timestamp1, resturn a list of maps with Limit results or less
          , audit_readGT/5    %% (User, Channel, Item, TS1, Limit)    read audit info after Timestamp1, return Limit results or less
          , hist_read/3       %% (User, Channel, KeyList)             return history list as maps for given keys
          , search_deleted/6  %% (User,s Channel, Ckey1, Ckey2, Text) from key at or after CKey1 to last key before CKey2, finds {K,V} with text in V
          , search_deleted_clients/6
          , search_deleted_objects/6
          , remove/3          %% (User, Channel, RowList)             delete a resource will fail if it was modified, rows should be in map format
  