Your sites must be added to your webmaster tools account. After I added my test sites, I was able to crawl the site search pages using the robots.txt file in the index, which prohibits site searches.
I managed to crawl the page, but for verification I checked the URL in the webmaster tools and it says the page is still hidden from the main google index. I added the same URL to the custom search index, and if I found it just fine.
Thus, this will allow you to search your test site, but not hide it from the world search.
styks source share