Site Search

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

Monday, 13 December 2010

More power to metadata

Posted on 09:23 by Unknown
Last year, we introduced structured custom search. If you mark up your pages with custom metadata attributes, you can render them with your search results, and also restrict results based on specific attribute values.

Today, we’re happy to be releasing 2 additional metadata features:
  • Sort by Attribute: order search results based on values of specific attributes
  • Restrict to Range: only return search results with attributes within a defined range
For example, if you mark up your pages with custom metadata attributes, like dates, ratings and prices, you can order your search results by these attributes, such as sort by date, bias towards highly rated items, or restrict to a specific price range.

SignonSanDiego.com, a California news portal, uses the new Sort by Attribute feature in conjunction with the Google Custom Search Element to render recent stories with photos in the results:


SignOnSanDiego uses the new sort operator. The sort operator comes in several flavors, from a mild bias to strict sort ordering; SignonSanDiego.com uses a strong bias towards the publication date to ensure readers see not only the most relevant, but also timely news.

To implement the new features, you must mark up the pages you are searching with the attributes you want to use. You can do this via PageMaps; the PageMap used by SignOnSanDiego looks like this:

<PageMap>
<DataObject type="date">
<Attribute name="displaydate" value="Wednesday, August 25, 2010"/>
<Attribute name="sdate" value="20100825"/>
</DataObject>

<DataObject type="thumbnail">
<Attribute name="src" value="http://media.signonsandiego.com/img/photos/2010/08/25/635a63e9-f4a1-45aa-835a-ebee666b82e0news.ap.org_t100.jpg"/>
<Attribute name="width" value="100"/>
</DataObject>
</PageMap>

SignOnSanDiego’s publication date is stored in the DataObject of type ‘date’ as the Attribute named ‘sdate’; to specify this field you combine the type and name into a single field ‘date-sdate’. To apply Sort by Attribute over date-sdate, you set the sort option in the search code for the Element as shown below:

...
var options = {};
options[google.search.Search.RESTRICT_EXTENDED_ARGS] = {'sort': 'date-sdate:d:s'};
customSearchControl = new google.search.CustomSearchControl('000525776413497593842:aooj-2z_jjm', options);
...
The sort option {'sort': 'date-sdate:d:s'} takes a combined attribute name, like ‘date-sdate’, and several optional parameters separated by colons. In this case, SignOnSanDiego has specified sorting in descending order (d) using the strong bias (s) flavor of the operator. Without qualifiers, the default is to use a descending order with a hard sort. You can also choose to sort in ascending order (a), or use a weak sort flavor (w) or explicitly specify a strict hard sort (h).

The sort option also enables the Restrict to Range feature. For example a site like SignOnSanDiego might enable users to search for articles published in the last week. To implement this, you can set the sort options to “date-sdate:r:20101206:20101213”. This again uses the combined attribute name (date-sdate), but instead restricts to the range (r) of specified values (20101206:20101213). Multiple operators can be combined in the sort option using a comma. For example, to combine SignOnSanDiego’s strong bias with the above date restriction, you would specify “date-sdate:d:s,date-sdate:r:20101206:20101213”.

The Sort by Attribute and Restrict to Range features are a powerful new set of options that gives you a great deal of control over your search application, allowing you to use custom attributes to order and restrict your search results in very powerful ways for your users. For example, a movie review site can display the most highly rated movies released within the last week by combining distinct attributes in the sort operator, e.g., “review-rating,release-date:r:20101206:20101213”.

A few more tips:
1. With custom data rendering, you can customize your results even further.
2. You can always validate your metadata markup with the use of the rich snippet preview tool.
3. If you are not using the Element, you can always use the same sort options in the sort URL parameter, e.g., “&sort=date-sdate”.

For more details on these new features, please refer to our documentation. As always, we’re looking to you for feedback.

Posted by: Anthony Francis and Roger Wang, Software Engineers
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)
      • More power to metadata
    • ►  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)
    • ►  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