johnangularjs / google-ajax-apis

Automatically exported from code.google.com/p/google-ajax-apis
0 stars 0 forks source link

GwebSearch.setSiteRestriction does not work with CSE's with partner-pub- id prefix #110

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create an application with GwebSearch
2. Call websearch.setSiteRestriction('partner-pub-...');
3. Run a search (e.g., for 'test')

What is the expected output? What do you see instead?
The web searcher should run a search against the specified CSE, but it does
not. Rather, it searches against the primary web index.

Please use labels and text to provide additional information.

test CSEs:
http://www.google.com/coop/cse?cx=partner-pub-6145881183380564:33aq8i-ih3m&hl=en
http://www.google.co.uk/cse?cx=partner-pub-3986313354747673%3Az7xub9pjyqz&ie=ISO
-8859-1

Repro code:
(function(){
(function(){
 var siteSearch = new google.search.WebSearch();  
 siteSearch.setSiteRestriction('partner-pub-6145881183380564:33aq8i-ih3m');
 siteSearch.setSearchCompleteCallback(window,function(){
  for(var i=0;i<siteSearch.results.length;i++){
   var res=siteSearch.results[i];
   if(res.html){
    document.getElementsByTagName('body')[0].appendChild(res.html);
alert(res.url);
   }
  }
 });
 siteSearch.execute('test');
})();

Original issue reported on code.google.com by jrgeer...@gmail.com on 16 Sep 2008 at 12:23

GoogleCodeExporter commented 8 years ago
Will this ever be corrected?  It has been over 1 year this this issue was 
raised!!

Original comment by adv...@hdhes.com on 4 Dec 2009 at 1:02