add entity groups and ancestor filter