Adding custom configuration to Dimension Matchmaker
In the HCL Commerce Search, you can run natural-language searches using product dimensions (Length, Width, Height) in product search queries. The product dimension pattern can be configured in the zookeeper dimensions node. If no pattern is specified, then the default WLH pattern is used.The product depth dimension can also be configured in the zookeeper dimensions node by setting up the potential value (Width, Length, Height) for the key. This value of the key is used as a replacement of D (deep/depth/thick/thickness) while indexing (for example, 10 m L x 20 m H x 30 " D ) and while searching (for example, find 10 m L x 20 m H having depth 20 " ) products at the storefront. New product dimensions are added using the POST request method. The existing product dimensions are updated using the PATCH request method.
Endpoint
http://{host}:{port}/search/resources/api/v2/configuration?nodeName=dimensions&envType=auth&locale=en_US
Example
{
"pattern": “LWH”,
“key”:”width”
}
Sample JSON configuration usage
The pattern
parameter is used when no dimensions are provided by the
shopper while searching for the products at the storefront. For example, the shopper
used the search term, 120cm x 75cm x 80cm table, to search for a table at the
storefront. Since in the search term the shopper has not provided any dimensions for
the table, the search results are displayed based on the specified
pattern
configuration (LWH
) in Zookeeper.
Based on this configuration, the following dimensions are used by HCL Commerce Search to fetch the search results at the storefront:
Length: 120cm, Width: 80cm, Height: 75cm
The pattern
parameter is not used when a shopper has provided the
specific dimensions while searching for the products at the storefront. The search
results are displayed at the storefront based on the dimensions provided by the
shopper in the search term. For example, 60cm W x 80cm L x 70cm H table. Based on
these shopper provided dimensions, the following dimensions are used by HCL Commerce Search to fetch the search results at the storefront:
Length: 80cm, Width: 60cm, Height: 70cm
HCL Commerce Search does not index depth(D). It only indexes Width, Length,
and Height. So, the Key
parameter is used to convert this
D/depth/thickness into one of the Width, Length, or Height. This D/depth/thickness
is converted based on the specified Key
configuration
(width
) in Zookeeper. For example, the shopper used the search
term, 10 cm H x 20 cm L x 30 cm D, to search for a food storage container at the
storefront. While fetching the search results at the storefront HCL Commerce Search replaces this D with the specified Key
configuration (width
) in Zookeeper. The following dimensions are
used by HCL Commerce Search to fetch the search results at the
storefront:
Height: 10 cm, Length: 20cm, Width: 30 cm
In case of conflict between pattern
and Key
parameters configured in Zookeeper, the fallback WLH
configuration
is used for the pattern
. For example, the shopper used the search
term, 10cm L x 20cm W x 30cm D, to search for a food storage container at the
storefront. In this case, HCL Commerce Search replaces D with the specified
Key
configuration (width
) in Zookeeper. So,
the pattern
for search processing results into
LWW
,
Length: 10cm, Width: 20cm , 30 cm Height:
<Empty>. HCL Commerce Search does not consider this pattern to fetch the
search result at the storefront. It neglects the pattern
configuration (LWH
) set in Zookeeper and fallbacks to
pattern
configuration, WLH
. The following
dimensions are used by HCL Commerce Search to fetch the search results at the
storefront:
Width: 10 cm, Length: 20cm, Height: 30cm
Configure fallback unit of measurement
{
"pattern": “LWH”,
“key”:”width”,
“uom”: inch
}
In the aforementioned JSON “uom”: inch indicates that inch has been configured as a fallback unit of measurement. This means when the shopper searches for the box using the search query, 5 x 5 box, then the HCL Commerce Search returns the search results using the fallback unit of measurement inch that has been configured in the aforementioned JSON.