This isn't exactly what you asked for, but it's a start. If you want
some functionality that more closely mirrors the Custom Search, you
could have a table of links at the top of your search page that has a
link for each of the refinements in your CSE, and a single
GwebSearch. When a user clicks one of the refinement links, call
setSiteRestriction on your GwebSearch with the appropriate label and
then execute the GsearchControl that contains it.
HTH,
--James
function cse(SearchExpression) {
var sFormDiv = document.getElementById("searchForm");
var leftScDiv = document.getElementById("leftSearchControl");
// create a left, right search control
// create a custom search form
this.leftControl = new GSearchControl();
this.searchForm = new GSearchForm(true, sFormDiv);
var searcher;
var options;
// configure left control
// Site Restrict to CSE ID for Search
var cseId = my cseid goes here...;
searcher = new GwebSearch();
options = new GsearcherOptions();
searcher.setSiteRestriction(cseId, searchExpression);
options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
this.leftControl.addSearcher(searcher, options);
...
...
...
}
function OnLoad() {
new cse("");
}
function RefineSearch(SearchExpression) {
new cse(SearchExpression);
}
One of the field from HTML table for refine search ...
<a href="javascript:RefineSearch('XYZ');">XYZ</a>
What should I call on the click of the refine search field? I tried to
call the cse() function on the click by passing the value for the
refine search, but it just clears the search input box and nothing is
displayed.
Could it possible for you to explain the same (if possible with the
code) so that i can correct my self on that?
Hello, I have created the table at the top of the search with the
fields that are required for my refine search.
But, I am not sure that the way I am going to get the results for the
refine search. I am briefly explaining my code below...
function cse(SearchExpression) {
var sFormDiv = document.getElementById ("searchForm");