The Suggest and Search Portlet is a JSR286 portlet that provides search related suggestions and search results for the web. It is based on Yahoo Contextual Search and Yahoo Web Search Service API.
Design
There main portlet (viz) SearchPortlet? implements the serveResource method to make REST based calls to the Yahoo services using Jakarta HttpClient?. The Suggestion Results are obtained in XML format, while the Search Results are obtained in JSON format . These are parsed using Javascript.
As the user types in the Search box, suggestions related to the search text typed till then are displayed as a dropdown. On selecting a word from the dropdown or keying a word and on pressing 'Search', Web Search results are displayed. Page refresh does not happen during suggest or search, since they are Ajax based calls.