anchor.diff:          ?assertEqual([History1, History2, History3], HistResult),
   
           %% Search history for test
  -        HistSearchResult1 = search_deleted(system, ?Channel, <<"test">>, [], maps:get(ckey, Map3),5),
  +        HistSearchResult1 = search_deleted(system, ?Channel, <<"test">>, [], maps:get(ckey, Map3),false),
           ?assertEqual(3, length(HistSearchResult1)),
   
           %% Search for 150
  -        HistSearchResult2 = search_deleted(system, ?Channel, <<"150">>, [], maps:get(ckey, Map3),5),
  +        HistSearchResult2 = search_deleted(system, ?Channel, <<"150">>, [], maps:get(ckey, Map3),false),
           ?assertEqual(1, length(HistSearchResult2)),
           ?assertEqual([{maps:get(ckey, Map3), maps:get(cvalue, Map3Upd)}], HistSearchResult2),
   
  -        %% Search history for limit
  -        HistSearchResult3 = search_deleted(system, ?Channel, <<"test">>, [], maps:get(ckey, Map3),2),
  -        ?assertEqual(2, length(HistSearchResult3)),
   
           %% Using sext encoded Keys
           EncodedKeys = [imem_datatype:term_to_binterm(maps:get(ckey, Map1))
  
positive.code:     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) ->
      [Key1, Key2, LText, HistTableName] = search_deleted_init(CKey1, CKey2, Text, Channel),
      SearchFun = fun() -> find_deleted(HistTableName, imem_meta:next(HistTableName, Key1), Key2, LText) 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) ->
      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) ->
      NewAcc =  case imem_meta:read(Table, Key) of
          [#skvhHist{cvhist = [#skvhCL{ovalue = Value, nvalue = undefined}| _]}] ->
              [LValue] = imem_index:vnf_lcase_ascii(Value),
  
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
  