Flex Google Search Component
Google Search has an Ajax API that can be used to execute search directly from the browser to the Google servers without the need for intermediate server side code on your website. Executing a search from Flex or Flash reduces to invoking the Google Search api with the apikey, specifying the type of resultset size you want (full or compact) and parsing the JSON reply.
Sounds simple? We are not quite yet done though. You also need to build a display page for the results, provide navigation capabilities to go to the previous or next page or jump to any page. Invocating the Google Search API, building the clickable search results and the related navigation to more results can be componentized as in this Google Search Flex Component. Some of the nice features of this component are
- No server side code
- Supports 2 styles – “Compact” space saver and the “Full” style
- Customizable Item renderers
- AIR capable
It comes with full API documentation and examples so putting a Google Search on your Flex or Flash application is as easy as drag-drop. Since this is a pure Actionscript search with some minor MXML changes, you can make it work from Flex 4 as well. You can get the full specification sheet for this component and jump to the live demo page by clicking here.
Want to use this component just from HTML and not inside Flex or Flash? That works too! just try out the live demo below on this WordPress page…