Applying Styles to Search Results

February 27, 2007

We have always strongly supported those of you wishing to re-style AJAX search results. Each search result contains a number of properties (like title, visible url, snippet, etc.), as well as a standard .html property. Note: while it's ok to re-style a search result, it is not ok to change the search result values (e.g., its not ok to replace a Google delivered url of http://www.vw.com/gti/ with http://please-click-on-this-virus-url.com).



One way to get the look and feel that you need is to build your own representation of a search result using the result's core properties. This is the technique that we use in the News Bar, the Video Bar, the Map Search Control, etc.



Another very powerful approach is to use the .html property either standalone, or in conjunction with the core Search Control, and then use customized CSS rules to re-style the .html node. Using this approach you can select fonts, colors, spacing, visibility, borders, etc. We stil advocate using Firefox's DOM Inspector or the Firebug Extension to get a feel for the DOM structure of a result. In addition, this morning, we published the skeleton format of each search result type. This should help those of you that are not fluent in DOM Inspector or Firebug.



As always, let us know what you think in the AJAX Search API developer forum. If this documentation style is a helpful way for you to learn about the DOM structure of a search result, we will use the same approach to document the DOM structure of the various search controls.



And finally, I know many of you are working hard to extend the Map Search Control. In an effort to make your attempts at this more robust and reliable, this morning, we published a formal mechanism (and sample) that you can use to gain access to the GMap2 objects that are at the heart of this control.

More localized search controls

February 15, 2007

The AJAX Search API has always included a localized text based Search Control where the user-interface is presented in the language of the site visitor. The API includes a number of advanced search controls including:

These controls have seen strong world wide adoption. This afternoon, we upgraded all of these controls so that the user-interface they present is also localized and tracks the user-interface language of the underlying AJAX Search API.


The AJAX Search API auto-detects the user-interface language of your visitors and adjusts the UI accordingly. If you want to, you can hard code the user-interface language by using the &hl argument in your AJAX Search API script load tag. For example, to hard code your user-interface language to french, change your load tag to include: <script src="...api?file=uds.js&hl=fr...">


As always, please let us know what you think in the AJAX Search API developer forum.

Adding Google News and Book Search

February 7, 2007

We just launched a new cut-and-paste solution for the AJAX Search API that lets you embed a dynamic Google News bar in your web pages:



Just enter the searches you want to power the news bar, and the AJAX Search API does the rest. We support two different form factors — a thin horizontal strip and a wider vertical bar — so it's easy to incorporate dynamic news content into the layout of your site.


We've also added support for Book Search to the AJAX Search API. To make it easy to get started with this new type of search, we created a cut-and-paste solution for a dynamic "book bar" just like the News bar above. So if you have a site related to, say, fish, you can integrate a dynamic bookshelf of fish-related books without writing a line of code — a fun way to attract new visitors to your site.


Let us know what you think in the AJAX Search API developer forum.