Find categories through products

Hi, we are using Algolia with Magento. I would like to show categories in the suggest/autocomplete, that contain a product that matches my search.
So if I search for “Shirt” I will get product results for shirts but also category results for “Men’s wear”, because this category has shirts in it. How to achieve that?

Thanks
Jörg

@haroen You helped me many times before. Any idea? Thanks a lot.