You should be able to use Katello::Distribution.create_index for this