@Jeremy:
IIUC, the CustomSearchControl is still supported, as it remains
fundamental to the current Custom Search Element JS API. Here's some
current documentation:
http://code.google.com/apis/customsearch/docs/js/cselement-devguide.html
http://code.google.com/apis/customsearch/docs/js/cselement-reference.html
But see notes below regarding setSearchCompleteCallback.
__________________________________________________
@yotam:
Currently, IIUC, you can obtain the "searcher" as the 2nd argument to
the callback function that you assign via setSearchCompleteCallback or
setSearchStartingCallback.
NOTE: Usage shown below is NOT consistent with the CS Element JS
Reference's current description of setSearchCompleteCallback. (I
suspect perhaps that documentation may be in error?) Nonetheless, the
usage shown below still works for me at this time.
If you use setSearchCompleteCallback (on a CustomSearchControl) as
shown here, the search-completion callback function takes two
arguments: the search-control and the searcher.
customSearchControl.setSearchCompleteCallback(
this,
function(control, searcher) {
// ... etc. ...
});
If you use setSearchStartingCallback, the search-starting callback
function takes 3 arguments: the search-control, the searcher, and the
query string.
customSearchControl.setSearchStartingCallback(
this,
function(control, searcher, query) {
// ... etc. ...
});
NOTES:
The current CS Element JS Reference (2nd link above) documents the
setSearchStartingCallback and setSearchCompleteCallback methods. As I
mentioned, the usage that I've shown above is NOT consistent with the
CS Element JS Reference's current description of
setSearchCompleteCallback (I suspect a documentation error).
I don't know if the CS Element's implementation of those arguments may
be expected to change in the future (could someone from Google comment
on that)?
YMMV.
-- omr