If you use the Custom Search
Element, you can now add publisher-provided links to your search results based on specific metadata markup in your web pages. These special structured data objects, such as Thumbnails and Actions, are generated from the PageMaps you provide. For example,
Scribd, one of our partners, provides both Thumbnails and Actions in PageMaps on their pages, so we display both of these in our
sample Custom Search engine, as shown below. The Actions in this case are "
Download" and "
Fullscreen View", but each publisher can provide customized actions, which they can also style via CSS.
In the case of the above document, the PageMap markup for the Thumbnails and Actions is as follows:
<PageMap>
<DataObject type="thumbnail">
<Attribute name="src" value="http://i5.scribdassets.com/public/images/uploaded/70327880/D9mDLlYzlw_thumbnail.jpeg"/>
<Attribute name="width" value="100"/>
<Attribute name="height" value="130"/>
</DataObject>
<DataObject type="action">
<Attribute name="label" value="Download"/>
<Attribute name="url" value="http://www.scribd.com/document_downloads/20258723?extension=pdf"/>
<Attribute name="class" value="download"/>
</DataObject>
<DataObject type="action">
<Attribute name="label" value="Fullscreen View"/>
<Attribute name="url" value="http://d1.scribdassets.com/ScribdViewer.swf?document_id=20258723&access_key=key-27lwdyi9z21ithon73g3&version=1&viewMode=fullscreen"/>
<Attribute name="class" value="fullscreen"/>
</DataObject>
</PageMap>
If you markup your own pages, as shown above, the Element will render your Thumbnails and Actions in your own Custom Search engine.
Structured SearchThe above example shows how easy it is for you to add valuable metadata to your pages for use in display in Custom Search results. So, in the sample engine that we used above, here's what the result looks like when you type the query [halloween]. We see a set of nicely formatted results that match the query.
Wouldn't it be
nice to use these metadata attributes in your search? We think so too, so we've enabled a way for you to
restrict your search results via use of a special operator. Let's say that we wanted to restrict the results to those results that were authored by a specific author, e.g., "
lisamorton" (author of the second result above). We can easily do this by adding the following restriction in our search query: [halloween more:pagemap:document-author:lisamorton]. This gives us exactly what we want - documents authored by "
lisamorton":
Let's break down the
more:pagemap:document-author:lisamorton restriction. The
more: operator is what we use for refinement labels. The
pagemap: tells us to refine results by specific attributes in the indexed PageMaps. The
document-author: qualifier tells us to look for the specific attribute of interest - the
document DataObject in the PageMap with child attribute called
author. This is followed by
lisamorton, which is just the actual value that we are using for the restriction. You can use this open-ended syntax for querying the appropriate DataObjects in your own documents.
The PageMap that represents the document and author information in the markup of the above pages is as follows:
<PageMap>
<DataObject type="document">
<Attribute name="title">The Five Scariest Traditional Halloween Stories</Attribute>
<Attribute name="author">lisamorton</Attribute>
</DataObject>
</PageMap>
You can provide hooks in your application to filter results by attributes that are important for your users, so users will not have to type these restriction qualifiers directly.
Rich Snippet Preview ToolCheck out the
Rich Snippet preview tool. This tool allows you to view not only the Rich Snippets markup recognized for Google
web search, but also the
additional customized markup that we support in Custom Search. You can immediately see how your web page will be processed after indexing, and what metadata attributes will be returned in PageMaps in your Custom Search results. If there are any errors in your markup, you can fix them right away! Remember - you need to add the
&view=cse parameter to this tool to review the additional metadata extracted by Custom Search.
Here's a screenshot from the tool for one of the above results, showing all the PageMap markup recognized by Custom Search:
Many customers have asked for additional structured capabilities, richer snippet presentation and filtering and drill-down capabilities in Custom Search. We'd love to hear
feedback from you on these structured data features that offer you more power and flexibility to help users find what they are looking for on your site.
Posted by: Anthony Francis and David Gibson, Software Engineers