Give the search pages a site_id

This commit also contains an extract method refactoring