Consider a board where the search feature is enabled (the default setting).
When browsing within a forum, there is a search box to directly search keywords inside that forum. But that search box is missing when you are browsing within a category (even if it has subforums, not an empty category).
However, you CAN search within a given category (and its subforum) in the Advanced Search.
So, why not adding the searchbox in viewforum.php when you're browsing inside a category?