Monday, September 5, 2011

Google Custom Search Engines

Google provides tools for creating a Customized Search Engine (CSE) that can be embedded in blogs and other websites to provide specialized searches. In this blog, for example, I might wish to provide an Astronomy search that would respond to a query for "tadpole" with a list of web pages providing information about the galaxy by that that rather than web pages about immature frogs.

Blogger has a Search Box gadget that can be configured to search over a list of links, such as the Space Exploration links listed on the side panel of this blog. I could use that to create a search that would query only the websites in the list, and this might give the kind of results I wanted in most cases. If I wanted to have a search feature like this within a post rather than on the sidebar, I could do that quickly and easily by visiting the webpage for Google's on-the-fly CSE to find code that I can add to my posting using the HTML editor.

The Blogger search box and the on-the-fly CSE are both limited to searching linked sites. With a little more effort, it's possible to create a CSE that is more finely tuned. Using Google's CSE wizard lets you create a gadget that you can embed using an automatically generated code snippet. You can later manage your CSE, editing and refining as you gain experience with its workings. Using this method, I've created a CSE for an Astronomy search and provided a gadget below that you can use to try that CSE. I haven't yet gone much beyond what the wizard creates, so you may or may not find the kind of information you're looking for. To see how it works, try searching on "tadpole," "egg," and "mice" -- and have fun comparing the orange links returned by the CSE with the sponsored links that appear above and to the right of those.