Categories: Implementation :

Custom Search Element API is fully documented now!

Showing 1-14 of 14 messages
Custom Search Element API is fully documented now! hxu-cse 1/13/12 9:27 PM
Our blog post:

Documentation:

Please let us know your comments and suggestions!
omr 1/25/12 8:31 PM <This message has been deleted.>
omr 1/25/12 8:34 PM <This message has been deleted.>
Re: Custom Search Element API is fully documented now! omr 1/25/12 8:36 PM
Please correct an erroneous example in the Element reference ("opt_options" subsection).  This code cannot work as written.

  var options = { 'google.search.Search.RESTRICT_EXTENDED_ARGS' :
    {'as_sitesearch' : 'examplepetstore.com/dogs/*'} };

I'd suggest rewriting that example as follows:

  var options = {};
  options[google.search.Search.RESTRICT_EXTENDED_ARGS] = {
    'as_sitesearch' : 'examplepetstore.com/dogs/' };


-- omr
Re: Custom Search Element API is fully documented now! hxu-cse 2/9/12 3:57 PM
Thanks for pointing this out!  The doc should have been fixed.
Re: Custom Search Element API is fully documented now! _CSESurfer 2/17/12 12:38 PM
I noticed this link target only works for Web Results:
 
customSearchControl.setLinkTarget(google.search.Search.LINK_TARGET_BLANK);
 
How about for Ads by Google? 
 
...It's default is _SELF or _PARENT and does not open to new window.
Re: Custom Search Element API is fully documented now! Mareck 10/17/12 7:06 AM
On https://developers.google.com/custom-search/docs/js/cselement-reference it still shows:

options[google.search.Search.RESTRICT_EXTENDED_ARGS] = {'as_sitesearch' : 'examplepetstore.com/dogs/*'};
This however no longer works and gives you no results when searching. It should be:
options[google.search.Search.RESTRICT_EXTENDED_ARGS] = {'as_sitesearch' : 'examplepetstore.com/dogs'};
For one of my sites the search hasn't been working for a while because of this change (No idea when it was changed. Visitors usually don't report errors but just leave when something unexpected happens). 

Took me quite some time to figure this out because the documentation is wrong.

Re: Custom Search Element API is fully documented now! vikramv2575 11/19/12 6:00 PM
I am having trouble using the API to modify the sites in a Custom Search Engine. When I use the API in the documentation, the return code says that it is done but I cannot see the changes while querying the CSE nor when looking at the CSE using the Control Panel.
The API seems to be wrongly documented. Is there anywhere that you can point me?

Thanks,
Vikram
Re: Custom Search Element API is fully documented now! Ambika0001 1/15/13 8:00 AM
Can you tell me exactly how are you trying to add sites to your cse?
Re: Custom Search Element API is fully documented now! Simon habte 1/30/13 2:38 PM

Re: Custom Search Element API is fully documented now! Rudy Martinez 2/1/13 12:19 PM
how I can remove remove the Google logo that is in the search box and put the logo on another  box my web?...I can do this?
Re: Custom Search Element API is fully documented now! Rudy Martinez 2/1/13 2:17 PM
Re: Custom Search Element API is fully documented now! Ernest Burnett 2/26/13 4:01 PM
There's probably a way but it's more trouble than it's worth. Basically, telling the browser to yank the spyglass once the script has generated the image after the script goes through all that work is self defeating - you'd be better of starting off with a minimal theme (text) and then adding a background image through property preference.

The main problem is the new default theme the script calls, won't let you over-write the "spyglass" image. There's another issue where if you use box-sizing in your site design, it will collapse the button and render the theme unusable (in terms of graphical appearance). If you do try to replace the v2 style image call with a background image, you'll get a double spyglass, one with your's and one with google's once you adjust for the collapse. Your best bet is to go with a similar theme with no icon, but if there is an easier way to knock out the spyglass, then you could find the css the theme uses, set !important styles to the selectors to override and add image/edits from your own stylesheets (theme without source set to button). The farthest I got was Chrome showing the regular spyglass, but Firefox showing an exploded version of it, as the selectors are compounded both in the table and button where they shouldn't be.

<td class="gsc-search-button"><input title="search" class="gsc-search-button gsc-search-button-v2" src="http://www.google.com/uds/css/v2/search_box_icon.png" type="image"></td>

This is the particular offender - if it were a simple background image then you'd be able to over write it but because it's outside of the class selector, it's basically hardcoded in. Hiding everything away in a script that generates a script sucks because you have to hunt down everything - why this way?

Much prefer to see workable min files and styles work with v2. At the least, links the to css themes given so we can experiment.

Here's the v2 default theme, but expect changes: http://www.google.com/cse/style/look/v2/default.css.

(Spyglass called in markup above)

Google please fix or add an alternate default theme without a src set on the button, thanks. @eb_p1 twitter

(unknown) 4/5/13 8:25 AM <This message has been deleted.>