If I understand you have a category hierarchy, where the top categories are not associated with the post type objects, only the child categories. In this case, the search indeed won't be able to find anything, as nothing is associated with them.
However, there might be a solution. I made a small code snippet to get child terms if a parent element is found before the search. Try putting this into the functions.php file in your active theme directory:
If you use a different taxonomy as category, make sure to replace it $taxonomy variable value on line 6. Please mind, that this may not work at all, but still worth a try 🙂Best,
If you like my products, don't forget to rate them on codecanyon :)