I have an iKnow domain and a blacklist called Ads. I want to get all sources that do not contain entities from Ads list. Currently I'm doing it like this: ClassMethod NoAds() { #dim domainid As %Integer = 1 set filterNot = ##class(%iKnow.Filters.GroupFilter).%New(domainid,, $$$YES) #dim blackListId As %Integer = ##class(%iKnow.Utils.MaintenanceAPI).GetBlackListId(domainid, "Ads") set sc = ##class(%iKnow.Utils.MaintenanceAPI).GetBlackListElements(.blackList,..#DomainId, blackListId) set filterAds = ##class(%iKnow.Filters.ContainsEntityFilter).%New(domainid, .blackList) set sc = filterNot.AddSubFilter(filterAds) #dim page As %Integer = 1 #dim pagesize As %Integer = 0 set sc = ##class(%iKnow.Queries.SourceAPI).GetByDomain(.result, domainid, page, pagesize, filterNot) zw result } To test results I set GroupFilter to not Negated so just GroupFilter:%New(domainid), I got this results:
> zw result .... result(9993)=$lb(977,"974") result(9994)=$lb(642,"635") result(9995)=$lb(520,"521") result(9996)=$lb(473,"472") result(9997)=$lb(284,"286") result(9998)=$lb(218,"218")But if I execute this SQL:
SELECT Id, Text FROM Test.Data WHERE Id In (218, 284, 286, 472, 473)I don't get results that contains entities from Ads blacklist. I also tried to remove GroupFilter altogether and pass ContainsEntityFilter directly but got the same results