Custom Search Engine Support
October 24th, 2006 | Published in Google Ajax API
Last night Google launched the Google Custom Search Engine. (You can read more on the Google Blog.) We added support for this to the AJAX Search API so you get results from your Custom Search Engine through GwebSearch().
Your Custom Search Engine is identified by its ID, which shows up as a "cx" value in the search box code (e.g., "000455696194071821846:reviews"). In order to restrict a web search to only search results from your Custom Search Engine just call .setSiteRestriction() and pass it its unique ID. You can read more about this in our online documentation.
It's not our style to leave you hanging with just words, so we put together a sample application that uses Custom Search Engines with the AJAX Search API. The sample application uses four Custom Search Engines: one that's all about product reviews, one for price comparisons, one for forums and message boards, and one for shopping. In addition, we threw in a tab for Blog Search, one for unrestricted Web Search, and one for News. For a little color, there's a Video Bar across the bottom as well. In addition to demonstrating Custom Search Engines, the sample also shows some advanced CSS styling and coordination of multiple search controls from a single search form. We hope you find this useful, and we'll look for your comments in the developer forum.
Your Custom Search Engine is identified by its ID, which shows up as a "cx" value in the search box code (e.g., "000455696194071821846:reviews"). In order to restrict a web search to only search results from your Custom Search Engine just call .setSiteRestriction() and pass it its unique ID. You can read more about this in our online documentation.
It's not our style to leave you hanging with just words, so we put together a sample application that uses Custom Search Engines with the AJAX Search API. The sample application uses four Custom Search Engines: one that's all about product reviews, one for price comparisons, one for forums and message boards, and one for shopping. In addition, we threw in a tab for Blog Search, one for unrestricted Web Search, and one for News. For a little color, there's a Video Bar across the bottom as well. In addition to demonstrating Custom Search Engines, the sample also shows some advanced CSS styling and coordination of multiple search controls from a single search form. We hope you find this useful, and we'll look for your comments in the developer forum.