I'm using Google Custom Search and trying to use Refinement to redirect search queries to other websites.
I follow the example from https://developers.google.com/custom-search/docs/refinements#redirect but it doesn't work.
When I click a refinement link (tab), instead of redirecting, it just shows "No Results" on the same page.
Here is my XML CSE Context code:
<?xml version="1.0" encoding="UTF-8" ?>
<CustomSearchEngine id="<my_search_engine_id>" creator="<my_creator_id>" language="en" encoding="UTF-8" enable_suggest="true">
<Title>my.domain.name</Title>
<Context>
<Facet>
<FacetItem title="Google Scholars">
<Label name="google_scholars" mode="FILTER"/>
<Redirect url="http://scholar.google.com/scholar?q=$q"/>
</FacetItem>
</Facet>
<BackgroundLabels>
<Label name="_cse_4zii28iwa6o" mode="FILTER" />
<Label name="_cse_exclude_4zii28iwa6o" mode="ELIMINATE" />
</BackgroundLabels>
</Context>
<LookAndFeel nonprofit="false" element_layout="8" theme="7" custom_theme="true" text_font="Arial, sans-serif" url_length="full" element_branding="show" enable_cse_thumbnail="true" promotion_url_length="full" ads_layout="1">
<Logo />
<Colors url="#008000" background="#FFFFFF" border="#FFFFFF" title="#0000CC" text="#000000" visited="#0000CC" title_hover="#0000CC" title_active="#0000CC" />
<Promotions title_color="#0000CC" title_visited_color="#0000CC" url_color="#008000" background_color="#FFFFFF" border_color="#336699" snippet_color="#000000" title_hover_color="#0000CC" title_active_color="#0000CC" />
<SearchControls input_border_color="#D9D9D9" button_border_color="#666666" button_background_color="#CECECE" tab_border_color="#E9E9E9" tab_background_color="#E9E9E9" tab_selected_border_color="#FF9900" tab_selected_background_color="#FFFFFF" />
<Results border_color="#FFFFFF" border_hover_color="#FFFFFF" background_color="#FFFFFF" background_hover_color="#FFFFFF" ads_background_color="#FDF6E5" ads_border_color="#FDF6E5" />
</LookAndFeel>
<AdSense />
<EnterpriseAccount />
<ImageSearchSettings enable="true" />
<autocomplete_settings />
<sort_by_keys label="Relevance" key="" />
<sort_by_keys label="Date" key="date" />
<cse_advance_settings enable_speech="true" enable_facet_search="true" />
</CustomSearchEngine>
I finally got an answer from the Google Enterprise Support team (4th August 2014) as follows:
"No, currently this feature is not supported and there are no plans to implement this feature in near future as well. We will be updating the documentation that this feature is not supported in custom search element code.
You can consider using XML API to retrieve results in XML , customize and display to end users as per your requirement."
来源:https://stackoverflow.com/questions/24715503/google-custom-searchs-refinement-doesnt-redirect-to-different-website