Site-based keyword redirects let you configure a keyword redirect group to send end users to a specified search results page in a site when they enter a search term or terms. The results page that the end user is sent to can be site-specific and might not be relevant for other sites in the application.

For example, Discover Cameras and Discover Printers sites might each have their own shipping information pages. A user shopping at the Discover Cameras site that enters "shipping" in the search bar is redirected to a shipping page that is unique to Discover Cameras rather than a global shipping page for all Discover sites or a shipping page for Discover Printers.

Example 2. Site-based keyword redirect group example

The browse page context.xml file at \Discover\config\import\pages\DiscoverCameras\browse has a redirects group with a unique redirects group name of DiscoverCamerasGrp.

<ContentItem type="Page" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://endeca.com/schema/content/2008">
  <TemplateId>PageSlot</TemplateId>
  <Name>Desktop Browse Page</Name>
  <Property name="contentPaths">
    <List xmlns="http://endeca.com/schema/xavia/2010">
      <String>/content/Web</String>
    </List>
  </Property>
  <Property name="templateTypes">
    <List xmlns="http://endeca.com/schema/xavia/2010">
      <String>Page</String>
    </List>
  </Property>
  <Property name="templateIds">
    <aaa:List xmlns:aaa="http://endeca.com/schema/xavia/2010"/>
  </Property>
  <Property name="ruleLimit">
    <String>1</String>
  </Property>
  <Property name="redirectGroup">
    <String>/redirects/DiscoverCamerasGrp</String>
  </Property>	
</ContentItem>

The JSON file for the redirect group is in a folder with a name that matches the property redirect string in the context.xml: \Discover\config\import\redirects\DiscoverCamerasGrp\_.json. Notice that the JSON file has a display name attribute that easily identifies the group for business users working in Workbench.

{
    "ecr:type": "redirect-group",
    "displayName": "Discover Cameras",
    "enableStemming": true,
    "redirects": [
        {
            "matchmode": "MATCHEXACT",
            "url": "/browse/Canon/_/N-1z141ya",
            "searchTerms": "canon"
			"searchTermExpansions": {
      			"0": {"canon": ["canon"]}
        	}
			},
        {
            "matchmode": "MATCHEXACT",
            "url": "/contact-us",
            "searchTerms": "locations"
			"searchTermExpansions": {
      			"0": {"locations": ["location"]}
				}
        }]
}

The properties of this JSON file are described in Public JSON Formats for Exported Content.



Copyright © Legal Notices