rewire gpg_keys for scoped search

In support of Redmine 7892
fixes #8686