Programmable Search Engine Blog
The latest news, updates and tips from the Programmable Search Engine team
Displaying the most relevant refinements
Monday, January 7, 2008
Posted by: Vrishali Wagle, Software Engineer
Over the past year, a number of you have asked to show only the matching refinements above Custom Search results. Today we're announcing that very feature: You can have as many FacetItems as you like in the
XML definition of your CSE
and control the number that display on a search page using this feature. Just add a "top_refinements" attribute to your context definition's CustomSearchEngine tag.
<CustomSearchEngine top_refinements="n">
</CustomSearchEngine>
Where n is the number of refinements you want to show.
For example, consider the context definition of a CSE I created:
http://vrishali.googlepages.com/food_context.xml
. It has sixteen FacetItems -- however, the top_refinements is set to 4. This means that it will display the top four matching refinements for every query. Check out the query
chicken
. Observe how the refinements displayed at the top are different for the query
food safety
.
Now consider the default implementation of the same CSE, that is without the top_refinements option:
http://vrishali.googlepages.com/food_context_no_top_refinements.xml
. All queries in this search engine will display the same refinements, for example
chicken
and
food safety
.
This feature is enabled for Linked CSEs as well as Google stored CSEs. To use it in your Google Stored CSE, download the context file in the "Advanced" tab of your control panel, add the "top_refinements" attribute to the CustomSearchEngine tag in your XML and upload the modified file.
If you don't want to display refinements at the top of the search results, turn them off by setting top_refinements="0". Your search results will still be labeled with the refinements that match.
As always,
let us know
what you like, or don't like, about this feature!
Archive
2024
Apr
2023
Dec
Oct
Jun
2022
Aug
Jul
Jun
Feb
2021
Apr
Jan
2020
Nov
Oct
Sep
Aug
Jun
Apr
2019
Jul
Jun
Apr
2018
Jul
2017
Jul
Feb
2014
Mar
2013
Dec
Oct
Sep
Mar
Jan
2012
Aug
Jun
May
Mar
Feb
Jan
2011
Dec
Nov
Oct
Sep
Aug
Jul
Jun
Apr
Mar
Feb
Jan
2010
Dec
Nov
Oct
Sep
Aug
May
Apr
Mar
Feb
Jan
2009
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2008
Dec
Nov
Oct
Sep
Aug
Jun
May
Apr
Mar
Feb
Jan
2007
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2006
Dec
Nov
Useful links
Programmable Search Engine
Help Center
Support Forum
Developer Documentation
Google AdSense Blog