Keep It Simple (and Free)
Unless you are stubborn or completely out of touch with reality you should be aware that Google provides the best search results for websites. Search functionality plays an integral role in the user experience for many sites. We will be looking at 3 different options. Two of these you can start using commercially. The other is currently in beta and not for commercial use. Nonetheless, you'll be able to have Google's search results on your website after finishing this article.
Google offers a Free Search feature to use on third party websites. This allows you to utilize Google's by narrowing the search results to a particular set of domain(s). With this service you are able to place your logo at the top of a page served by Google's server. Google also supplies the HTML needed to place a search box anywhere on your site. To implement this search feature into your website you simply need to register for the free service. You can do this at the following URL: http://services.google.com/cobrand/free_trial.
Customizations? It'll Cost You
If the previous method didn't provide enough flexibility, then you can upgrade to the Silver or Gold Search. This has all of the functionality as the free Google Free Search with some additional features. The Gold and Silver Search account allows you to place custom HTML at the top and bottom of the search results page. This would allow you to not only place your logo on the page but you could also include your site navigation as well as advertising banners. You can also view monthly reports that include the number of search queries performed per day. You can sign up for a Silver or Gold Search at the following URL: http://www.google.com/services/silver_gold.html.
The Elusive Google Web API
The third method allows by far the most customization. However, this method is still in beta and can't really be used on sites, which generate a lot of searches. Importantly, this feature cannot be used for commercial use. The Google Web API allows developers to utilize Google's search on a number of platforms including Java, .NET, and any platform that supports web services. Let's have a look at what we need in order to get started. Here is an introduction into how to get started: http://www.google.com/apis/.
Once you have signed up and received your license key you can begin testing. The developer's kit contains some very useful files which you should have a look through at your own leisure. We are going to proceed as if you are already somewhat familiar with the contents of the kit (which won't be completely necessary to complete our example).