@Wandermey: The IsItemLinkBookKnown method is what I use in AGS to filter motifs. They are listed in the lore library, so this works the same as with recipes.
Lua Code:
function KnownMotifFilter:FilterPageResult(index, icon, name, quality, stackCount, sellerName, timeRemaining, purchasePrice)
local itemLink = GetTradingHouseSearchResultItemLink(index, LINK_STYLE_BRACKETS)
local isKnown = IsItemLinkBookKnown(itemLink)
return (self.showUnknown and not isKnown) or (self.showKnown and isKnown)
end