Dual color name search using color matchmaker

Storefront users sometimes search for products using a combination of colors. For example, a customer might search for a "red and white dress." Dual color search is not activated by default, but you can add the capability.

How dual color searches work

Color family names are added as a single value attribute that is available along with the individual color family name. The category name contains a color name. During search, the color name is removed from the category name, and the remaining string is searched against the category classification fields.

For example, if Green Dress is the category name, then Green will be converted into a color filter, and Dress will get searched against the category fields.

Activating dual color search

To enable dual color search in the storefront, create a new attribute in the Management Center for HCL Commerce. The attribute code must end with dual_color. Such attributes can be created as assigned or pre-defined value attributes. When you add a value to this attribute, the attribute value must not contain more than two colors.

Separate the attribute color values using an & operator.

In the product index, natural.descriptive.colors, and natural.defining.colors field color details will be added. In the natural field color family name will be added for each color after splitting by &.

When the customer searches for a "red and white dress," any products with a dual color attribute are promoted and displayed. You can use the configuration API to ignore the "AND" conjunction. In this case, all the products with red and white are promoted first, followed by red or white, ignoring the "AND" operation and showing the result for red or white.

By default, ignoring the “AND” operator while a search is disabled enables ignoring "AND" while searching for color match maker. The following /configuration API is called.

PATCH/POST https://dataQueryHost:dataQueryPort/search/resources/api/v2/configuration?nodeName=component&envType=auth
Request Body:

	{
		"extendedconfiguration": {
			"configgrouping": [
				{
					"name": "SearchConfiguration",
					"property": [
						{
							"name": "IgnoreColorMMConjuction_AND",
							"value": "true"
						}
					]
				}
			]
		}
	}

Restart the Query after making this configuration change.

If this is the first time you are adding the configuration, use the POST request method. Otherwise, use the PATCH request method.

Attribute values are stored in the product index with the value given to the attribute.