Setting up a Hero product image (Product grouping)

Set up a Hero product image to increase the relevancy of products and search results in the storefront.

Overview

Here are several ways to configure a Hero product image, depending on your needs:If you want to learn how the Hero product image works, refer to Hero product image
Note: After configuration changes are made, restart the Query service to reflect the changes.

Set Hero product Image for category browsing

  • Enable or disable the Hero product image by adding the configuration to the Zookeeper wc-component node. The endpoint is, https://data_environment_hostname:30921/search/resources/api/v2/configuration?nodeName=component&envType=authAdd the configuration, hero.browsing.enabled=true/false .
    Note: New configuration are added to the component node using the POST request method. The existing configurations are updated using the PATCH request method.
  • By default, the Hero product image is enabled for category browsing in wc-component node, but the search profile, HCL_findProductsByCategory overrides it with the default configuration by disabling browse Hero product image. Enable or disable the Hero product image by adding configuration to the search profile in Zookeeper. The endpoint is, https://data_environment_hostname:30921/search/resources/api/v2/documents/profiles/profileName Add the group section with grouping field name to the search profile as :
    "group": {
    		"enable": "true",
    		"field": "relationship.product.group"
    	}
    
    Note:
    • If Hero product image is enabled in the wc-component node, then this configuration overrides the wc-component configuration. If Hero product image is disabled in thewc-component node, then this configuration does not take effect.
    • There are following three ways that can be used to change the configuration in the search profile,
      • Create a custom profile by extending the existing search profile as a parent profile, and then add the updated hero section to the custom profile.
      • Create a new search profile with all details from the parent profile. The profile name should not start with IBM or HCL. Pass this newly created profile name in profileName request parameter.
      • Override the default profile by creating the same profile using the configuration endpoint. The name of the profile should be the same as the default profile name.For example, HCL_findProductsByCategory. This profile should not have any parent profile. If you use this approach, then you don’t need to make changes in .jsp file at the store side to change the profile details for the rest call.
      Use the following endpoints to add the search profile configuration. Pass the JSON in request body.
      http://data_environment_hostname:30920/search/resources/api/v2/documents/profiles/XXX_findProductsByCategory 
      https://data_environment_hostname:30921/search/resources/api/v2/documents/profiles/XXX_findProductsByCategory 

    You can provide visual relevancy for keyword searches in the storefront by updating the value for overrideFieldName in the hero section of the search profile. This value contains a comma-separated list of elastic search field names. When specified, some properties of the most relevant item in the product/result group override the returned product properties. For example, thumbnail or name. The default value is thumbnail.

    "hero":
    {"overrideFieldName": "url.thumbnail,description.raw"}
  • Enable or disable Hero product image for category facets in the search request parameter by passing the search request parameter resultGroupForceTo. Pass the value as true/ false. If Hero product image is enabled in the search profile, then this parameter overrides the search profile configuration. If Hero product image is disabled in the search profile level then, this parameter does not take effect.

Promote representative SKUs in store pages using merchandising attributes

To promote representative SKU in store pages using merchandising attribute, add attribute id along with the value in the hero section of the search profile.


"hero": {
		"field": {
			"7741124012283334335": "Hero"
		}
}
Note: If the merchandising attribute is not set, then the most relevant SKU from the group are not promoted.

Show indexed price ranges for products in category pages

Add showGroupPriceRange to the hero section of the search profile. By default, it is disabled. To enable price range configuration, set value to true:
"hero": {
		"showGroupPriceRange": "true",
}

Examples

Sample JSON for configuring the Hero product image for keyword search :
{
	"extendedconfiguration": {
		"configgrouping": [
			{
				"name": "SearchConfiguration",
				"property": [
					{
						"name": "hero.searching.enabled",
						"value": "true"
					}
				]
			}
		]
	}
}

Sample JSON for configuring the Hero product image for Category browsing :
"extendedconfiguration": {
		"configgrouping": [
			{
				"name": "SearchConfiguration",
				"property": [
					{
						"name": " hero.browsing.enabled",
						"value": "true"
					}
				]
			}
		]
	}
}

Sample search profile configuration made by creating the custom search profile by extending the existing profile as a parent profile:

{
	"parentProfileName": "HCL_findProductsByCategory",
	"profileName": "XXX_findProductsByCategory",
	"query": {
		"group": {
			"enable": "true",
			"sort": "score desc",
			"field": "relationship.product.group"
		},
		"hero": {
			"overrideFieldName": "url.thumbnail",
			"showGroupPriceRange": "true",
			"field": {
				"7741124012283334335": "Hero"
			}
		}
	}
}

Sample search profile configuration made by creating a new search profile with all details from the parent profile :

{
	"profileName": "profileName",
	"indexName": "IndexName",
	"query": {
		"params": [
			{ "param1": "value1" },
			{ "param2": "value2" }
		],
		"queryFields": [
			"queryField1",
			"queryField2"
		],
		"provider": [
			"providerClass1",
			"providerClass2"
		],
		"preprocessor": [
			"preprocessorClass1",
			"preprocessorClass2"
		],
		"postprocessor": [
			"postprocessorClass1",
			"postprocessorClass2"
		],
		"responseFields": [
			"responseField1",
			"responseField2"
		]
	}
}
Sample search profile configuration made by overriding the default profile by creating the same profile using the configuration endpoint :
{
	"profileName": "HCL_findProductsByCategory",
	"indexName": "product",
	"query": {
		"params": [
			{ "param1": "value1" },
			{ "param2": "value2" }
		],
		"sortFields": {
			"1": "fieldName1 asc",
			"2": "fieldName2 asc",
			"3": "fieldName3 asc",
			"4": "fieldName4 desc"
		},
		"queryFields": [
			"queryField1"
		],
		"provider": [
			"providerClass1",
			"providerClass2"
		],
		"preprocessor": [
			"preprocessorClass1",
			"preprocessorClass2"
		],
		"postprocessor": [
			"postprocessorClass1",
			"postprocessorClass2"
		],
		"responseFields": [
			"responseField1",
			"responseField2"
		],
		"group": {
			"enable": "true",
			"sort": "score desc",
			"field": "relationship.product.group"
		},
		"hero": {
			"overrideFieldName": "url.thumbnail",
			"showGroupPriceRange": "true",
			"field": {
				"7741124012283334335": "Hero"
			}
		}
	}
}