Site Search

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Tuesday, 9 September 2008

Delivering Custom Search to your applications

Posted on 14:44 by Unknown
Posted by: Mark Lucovsky, Software Engineer

One of the most exciting things happening with our APIs is the clever use of Custom Search engines (CSEs), blended results, and innovative uses of UI components, resulting in rich user experiences. I'd like to highlight a few interesting applications that use the AJAX API with Custom Search, and then illustrate how Custom Search engines are accessed in the AJAX Search API. With a little effort, it is possible to get a very different search experience than the standard iframe version of CSE results to embed into your web site.

Over the last couple of weeks, users found interesting information about the U.S. elections and the party conventions at our 2008 U.S. Election page. In the center of the page, there's a page element based on the AJAX API that is designed to deliver a large amount of very specific election-related news and information in a very compact form factor. The tab labeled "Blog Posts" is simply a search on a specific CSE -- the CSE itself is simple, it covers a dozen or so well-read political blogs. This page element demonstrates the ability to deliver this in a very small form factor that's easy to place on any page. You can do a "view source" on the page and you will see what I mean. The AJAX Search API blog provides more details on how the elections page element, included below, was constructed.



Another good example is VisualDx Health. This site delivers health-related information through a very sophisticated CSE. Under the hood, it's a straightforward application that takes advantage of the underlying API. Multiple search requests are fired off in parallel to create this powerful categorized display of results. Rolling Stone takes a similar approach, but this site uses news in addition to multiple CSEs to create a segmented search experience to tailor the content to its specific audience.

Let's take a quick look at how CSEs are accessed using the AJAX Search API.
  • Take a plain old web search URL like this

    • http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=barack%20obama

  • Add a new CGI arg called &cx to refer to an existing custom search engine

    • http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=barack%20obama&cx=010222979794876194725:pqldevwuapa

Check the responses -- it's pretty easy. If you prefer using JavaScript objects, something like this also works:
var search = new google.search.WebSearch();
search.setSiteRestriction("010222979794876194725:pqldevwuapa");
search.execute("barack obama");
You can dig deeper to view how these applications are built. Using Firebug, you can also take a look at the "Net" tab to focus on the JS request/response stream while performing searches.

The AJAX API team is working to deliver Google services through a RESTful JSON/JSON-P based system, as well as the large collection of JavaScript classes and high level page elements that developers use to build these very clever sites. The combination of the AJAX APIs and CSEs is a pretty powerful system. Learn more by reviewing our documentation and posting questions/suggestions on our developer forum.
Email ThisBlogThis!Share to XShare to Facebook
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Custom Search Engine APIs
    Posted by: Matt Wytock, Software Engineer A couple of weeks ago we blogged about a new feature and a new kind of Custom Search Engine (CS...
  • Connecting with the Adobe Community with Google Site Search
    Posted by: Tom Duerig, Software Engineer We love Google Site Search. And when working with our customers, we often discover new and interest...
  • Autocompletion of queries in Custom Search
    One of the most requested features for Custom Search is autocompletion of queries. Today, we announced at Google I/O that you can now enab...
  • Star Power
    Posted by: Jay Davies, Community Manager If you've created a Custom Search Engine you've likely encountered the term 'URL patter...
  • Ads background colors in Custom Search
    As we continue to improve the look and feel of Google Custom Search Engine (CSE), today we’re announcing a change in how ads are displayed ...
  • Ads now in harmony with search results
    Posted by: Tom Duerig, Software Engineer Many folks have pointed out that all the results on the page -- both the search results and the adv...
  • Bootstrapping your CSEs from keywords
    Custom Search provides upto 5000 URL patterns to define a “slice” of the web to search over. However, if you’re creating a Custom Search Eng...
  • Integrating Custom Search with your service
    Posted by: Kevin Gollum Lim, Technical Writer Most people who need something just go to the store to get the item, but a number of people ta...
  • Custom Search at the core of Google Site Search
    Posted by: Matt Wytock and Vrishali Wagle, Software Engineers Today, we announced Google Site Search , a hosted website search product that...
  • Custom Search promotions made easier
    Posted by: Bartlomiej Niechwiej and Nicholas Weininger, Software Engineers Last year, we made it easier to promote relevant information to ...

Blog Archive

  • ►  2013 (5)
    • ►  December (1)
    • ►  October (1)
    • ►  September (1)
    • ►  March (1)
    • ►  January (1)
  • ►  2012 (8)
    • ►  August (1)
    • ►  June (1)
    • ►  May (1)
    • ►  March (1)
    • ►  February (2)
    • ►  January (2)
  • ►  2011 (18)
    • ►  December (2)
    • ►  November (4)
    • ►  October (1)
    • ►  September (2)
    • ►  August (1)
    • ►  July (1)
    • ►  June (3)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2010 (14)
    • ►  December (1)
    • ►  November (2)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  May (1)
    • ►  April (3)
    • ►  March (2)
    • ►  February (1)
    • ►  January (1)
  • ►  2009 (23)
    • ►  December (1)
    • ►  November (1)
    • ►  October (6)
    • ►  September (1)
    • ►  August (1)
    • ►  July (2)
    • ►  June (2)
    • ►  May (5)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ▼  2008 (18)
    • ►  December (1)
    • ►  November (1)
    • ►  October (2)
    • ▼  September (3)
      • Connecting with the Adobe Community with Google Si...
      • Beefed-up developer guide
      • Delivering Custom Search to your applications
    • ►  August (1)
    • ►  June (2)
    • ►  May (1)
    • ►  April (1)
    • ►  March (3)
    • ►  February (2)
    • ►  January (1)
  • ►  2007 (20)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  September (2)
    • ►  August (1)
    • ►  July (2)
    • ►  June (3)
    • ►  May (1)
    • ►  April (1)
    • ►  March (2)
    • ►  February (3)
    • ►  January (2)
  • ►  2006 (9)
    • ►  December (2)
    • ►  November (7)
Powered by Blogger.

About Me

Unknown
View my complete profile