Groups & documents can be excluded from the search (and smart groups/rules) via the Info > Generic inspector
By specifying a search scope it’s possible to limit the results to a certain database/group (and optionally its subgroups).
Especially the second option is more powerful than it might appear, e.g. by replicating a bunch of groups to a new group and then setting the search scope of smart groups/rules to this new group it’s possible to limit the results to the replicated groups.
Another possible workaround is to enable inherited tags (see File > Database Properties), then add a unique tag to the groups you want to search (no matter in which database) and finally use a smart group/rule condition for this tag.