Well I think it would be important to describe what exactly you're trying to "search" for. Is your site inventory based? Or is it just pages of information that you share?
If your site is inventory that you show, then it's entirely possible to create a database query to search for items off your site.
However, if your site is just pages of information with no database connectivity, then you may find it harder to write one yourself and thus should use a third party search such as google.
You could use google's api/ajax service for your site. I'd submit a sitemap.xml, and a robots.txt file for search engines to crawl your site.