Adding custom configurations to the Color Matchmaker

In the HCL Commerce Search you can run natural-language searches using colors in product queries. In ZooKeeper, colors are registered as a root node, and en_US is registered as a child of colors. Using this hierarchy you can maintain colors based on locale.

To add colors inside ZooKeeper using the configuration endpoint, pass the nodeName and locale mandatory request parameters. In case of English color names you can only update the list of colors; you can also add colors for other locale specific colors. To update the color value pass a data json file. New records are added using the POST request method. The existing records are updated (add, update, delete record) using the PATCH request method. To delete the record use the PATCH request method with an empty value for key.

Note:
  • For more information about the default color families provided by the HCL Commerce and the colors defined in these default color families, see About color families.
  • HCL Commerce Version 9.1.12.0No color configurations are available for the Finnish or Swedish languages in the default configuration. You can add these languages using the configuration endpoint.

Endpoint

The endpoint for this service is:
http://data_environment_hostname:30921/search/resources/api/v2/configuration?nodeName=colors&envType=auth&locale=en_US

Example

Following is a sample color_en_US.json configuration file for colors.
{
  "ghost white": "[[white],[248,248,255]]",
  "navajo white": "[[brown],[255,222,173]]",
  "midnight blue": "[[blue],[25,25,112]]",
  "darkslateblue": "[[blue],[72,61,139]]",
  "lightgrey": "[[black],[211,211,211]]",
  "dark khaki": "[[gold],[189,183,107]]",
  "light salmon": "[[red],[255,160,122]]",
  "saddlebrown": "[[brown],[139,69,19]]",
  "moccasin": "[[yellow],[255,228,181]]",
  "skyblue": "[[blue],[135,206,235]]",
  "deepskyblue": "[[blue],[0,191,255]]",
  "chartreuse": "[[green],[127,255,0]]",
  "mediumpurple": "[[purple],[147,112,219]]",
  "pale gold": "[[gold],[230,190,138]]",
  "peach": "[[yellow],[255,229,180]]",
  "olive drab": "[[green],[107,142,35]]",
  "palevioletred": "[[pink],[219,112,147]]",
  "dimgrey": "[[black],[105,105,105]]",
  "blanched almond": "[[brown],[255,235,205]]",
  "honeydew": "[[white],[240,255,240]]",
  "darkseagreen": "[[green],[143,188,143]]",
  "limegreen": "[[green],[50,205,50]]",
  "light slate gray": "[[black],[119,136,153]]",
  "green yellow": "[[green],[173,255,47]]",
  "peach puff": "[[yellow],[255,218,185]]",
  "lightsteelblue": "[[blue],[176,196,222]]",
}

In this example, "ghost white": "[[white],[248,248,255]]" means that ghost white belongs to the white color family. The numbers represent the most significant/closest RGB color code for ghost white from the RGB color wheel in the white color family.