A split-regex transformation divides the value of a dimension or property into separate values and assigns each separate value to a new dimension or property.

This transformation is useful when your product data contains an attribute whose value is a delimited list of values. Such a list is not usable for user navigation. However, the split-regex transformation can split the list into separate values that are useful for navigation.

The transformation uses a regex pattern to determine where to split the dimension or property value. The pattern can be either a single character or a more complex regex pattern; for example, the pattern:

"(\-\-)|[,;]"

specifies that a value is split at any occurrence either of two dashes or of a comma and a semicolon.

Suppose that your product data provides the following different values for a dimension named country:

"country": "UK, US, DE"

Such an assignment is not useful for user navigation by dimension. The split-regex transformation, however, can convert this assignment into assignments that are useful for user navigation, as follows:

"country": "UK", "country": "US, "country": "DE"

The conversion above is performed by the following split-regex transformation:

{
  "ecr:type": "attributes-owner-folder", 
  "country": {
    "ecr:type": "dimension", 
    "mergeAction": "update", 
    "indexingTransforms": [
      { 
        "transform":	"split-regex", 
        "pattern": "," 
      } 
    ], 
    "ignoreDuplicatePropertyValues": "true" 
  } 
} 

The following table lists the properties of the split-regex transformation:


Copyright © Legal Notices