You can you the PageManager to get a page from a path in a loop over your search hits:
PageManager pm = request.getResourceResolver().adaptTo(PageManager.class); SearchResult result = query.getResult(); for (Hit hit : result.getHits()) { Page page = pm.getContainingPage(hit.getPath()); Filter<Page> pageFilter = new PageFilter(); if (pageFilter.includes(page)) { // Matched... } }