Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: d85e325d18
Fetching contributors…

Cannot retrieve contributors at this time

59 lines (51 sloc) 2.099 kB
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="">
<author>Nagesh Susarla</author>
<documentationURL>See search.web and search.images for more details</documentationURL>
<sampleQuery>select * from {table} where query='pizza'</sampleQuery>
<select itemPath="results.result" produces="XML">
<paging model="offset">
<start id="start" default="0" />
<pagesize id="count" max="50" />
<total default="10"/>
<key id="query" type="xs:string" paramType="variable" required="true"/>
var qs = query;
var webquery = 'select * from search.web(' + start + ',' + count + ') where query=@query';
var search = y.query(webquery, {query: qs}).results;
var images = [];
default xml namespace='';
for each (var result in search.result) {
var theUrl = result.url;
// For any given URL from search only get the domain
// and use that as part of the search for images. This makes
// imagesearch much more richer
var idx = theUrl.indexOf("/", "http://".length);
if (idx > 0) {
theUrl = theUrl.substring(0, idx);
images.push(y.query('select * from search.images(1) where query=@query and url=@url', {url:theUrl, query:qs}));
var i = 0;
for each (var result in search.result) {
var image = images[i].results.result;
if (image) {
result.image = <image>{image}</image>;
response.object = search;
Jump to Line
Something went wrong with that request. Please try again.