The dir plugin might help you:
https://www.dokuwiki.org/plugin:dir.
For testing I created a page in a namesapce called
hidden and searched for a word that was contained in the page. The page was listed. Then I added namespace hidden to the hidepages config. Repeating the search gave no results any more. But the dir plugin was still listing/showing the page.