When a customer submits a text query, the QueryFormHandler has no information for selecting a refinement configuration. For this situation, you can configure ATG Search to determine the refinement configuration based on the items that are returned from the query. You do this by setting the following properties of the QueryRequest component:

refineConfig=$map
refineConfigMapProperty=ancestorCategories.$repositoryId

Setting the refineConfig property to $map instructs ATG Search to determine the refinement configuration by finding a metadata property value common to all of the results; refineConfigMapProperty specifies which metadata property to use. So these settings specify that ATG Search should use the refinement configuration associated with the lowest-level ancestor category that is common to all of the returned items. This refinement configuration will include the global facets plus any facets specific to that category. If there is no ancestor category common to all of the results, a refinement configuration that includes only global facets will be used.

For example, suppose your site has several root categories, including Electronics, Shoes, Books, etc. The hierarchy of the Electronics category looks like this:

Let’s say a customer searches for “Acme”. The search results consist only of TVs and stereos manufactured by Acme Audiovisual. So the lowest-level ancestor category that is common to all of the returned items is Home Theater. ATG Search uses the refinement configuration associated with this category.

Another customer searches for “Cogswell”. This time, the results consist of TVs and stereos manufactured by Cogswell Inc., but also books written by an author named Russell Cogswell. The results therefore do not have a common ancestor category, so ATG Search uses only the global facets.

 
loading table of contents...