Elasticsearch index schema changes

The following Elasticsearch index schema changes are performance and customization-related enhancements that were introduced with the HCL Commerce 9.1.7.0 and 9.1.9.0 releases.

HCL Commerce Version 9.1.9.0 or later

Product schema

Customizations that involve facets may encounter restrictions in HCL Commerce 9.1.9.0 and subsequent versions. The facets type has been changed from object to flattened, as defined in Ingest/config/product_elastic_schema.json.
"facets": {
  "type": "flattened"
}
For information about the features and limitations of this field type, see Flattened field type in the ElasticSearch Guide.
HCL Commerce Version 9.1.7.0 or later

Category schema

Element Schema change
_id In 9.1.7.0 and later releases, category ids are simplified by removing entries based on parentCategoryId.
  • In 9.1.6.0 and earlier releases, every time a category is linked under another parent category, a new document is generated.
    The _id field is constructed in the following format:
    storeId-langId-catalogId-parentCategoryId-categoryId
    For example, Apparel (categoryId=1) is a top level category (parentCategoryId=-1) in both the master catalog (catalogId=10001) and the sales catalog (catalogId=10502) within the AuroraESite store (storeId=1):
    "_id": "1--1-10001--1-1"
    "_id": "1--1-10502--1-1"
    If a category, Dress (categoryId=10001) is linked under another sales category (categoryId=3074457345616677668), then there are three documents with the following _id:
    "_id": "1--1-10001-3-10001"
    "_id": "1--1-10502-3-10001"
    "_id": "1--1-10502-3074457345616677668-10001"
  • HCL Commerce Version 9.1.7.0 or laterIn 9.1.7.0 and later releases, the same category within the same catalog has only one document.
    The _id field is in the following format:
    storeId-langId-catalogId-categoryId
    For the same example of Apparel above, the _id field of the category has the format:
    "_id": "1--1-10001-1"
    "_id": "1--1-10502-1"
    For the category, Dress, which is linked under another sales category, Hot Buys, there are two documents:
    "_id": "1--1-10001-10001"
    "_id": "1--1-10502-10001"
category In 9.1.7.0 and later releases, category definitions are simplified into single entries, by enabling them to be defined with multiple parents.

Top level categories

  • In 9.1.6.0 and earlier releases, the category element has both path and child elements.
    "category": {
        "sequence": 4.0,
        "catalog": "10001",
        "path": {
            "name": [
                "Apparel"
            ],
            "id": [
                "1"
            ]
        },
        "child": [
            "2",
            "3",
            "4",
            "5"
        ]
    }
  • In 9.1.7.0 and later releases, the child element is moved up to the same level as the category element, and the path element is removed.
    "category": [
        {
        "parent": "-1",
        "sequence": 1.0
        }
    ]
        "child": [
        "2",
        "3",
        "4",
        "5"
    ]
Leaf categories

A leaf category, Dress, is under the category, Women, as well as the Hot Buys sales category.

  • In 9.1.6.0 and earlier releases:
    • There are two documents within the sales catalog (10502). One document is under the Women category (3), and a second document is for the Hot Buys category (3074457345616677668).
    • Each document has a single value path element.
    • "category": {
          "parent": 3,
          "sequence": 0.0,
          "catalog": "10502",
          "path": {
              "name": [
                  "Apparel",
                  "Women",
                  "Dresses"
              ],
              "id": [
                  "1",
                  "3",
                  "10001"
              ]
          }
      }
      "path": /1/3/10001"
    • "category": {
          "parent": 3074457345616677668,
          "sequence": 0.0,
          "catalog": "10502",
          "path": {
              "name": [
                  "Hot Buys",
                  "Dresses"
              ],
              "id": [
                  "3074457345616677668",
                  "10001"
              ]
          }
      }
      "path": "/1/3/3074457345616677668"
  • HCL Commerce Version 9.1.7.0 or laterIn 9.1.7.0 and later releases:
    • There is only one document in the sales catalog. This contains both the Women category (3), and the Hot Buys category (3074457345616677668).
    • The path element can now contain multiple values.
    • The sequences element is at the same level as category, for sorting.
    "category": [
        {
        "parent": 3,
        "sequence": 0.0
        },
        {
        "parent": 3074457345616677668,
        "sequence": 0.0"
        }
    ]
    
    "path": [
        "/1/3/10001",
        "3074457345616677668/10001"
    ]
    
    "sequences": {
        "3": {
            "sequence": 0.0
        },
        "3074457345616677668": {
            "sequence": 0.0
        }
    }
HCL Commerce Version 9.1.7.0 or later

Product schema

Element Schema change
identifier In 9.1.7.0 and later releases, the pn element is removed. This is due to the fact that it duplicates the values of the sku element.
For example:
  • In 9.1.6.0 and earlier releases:
    "identifier": {
        "specification": "product",
        "language": "en_US",
        "sku": {
            "normalized": "AuroraWMDRS-1",
            "raw": "AuroraWMDRS-1"
        }
        "pn": {
            "normalized": "AuroraWMDRS-1",
            "raw": "AuroraWMDRS-1"
        }   
    }
  • In 9.1.7.0 and later releases:
    "identifier": {
        "specification": "product",
        "language": "en_US",
        "sku": {
            "normalized": "AuroraWMDRS-1",
            "raw": "AuroraWMDRS-1"
        }
    }
category In 9.1.7.0 and later releases, the category element is simplified by removing path entries. This information is placed into a peer element, path_name. The category entry only contains direct parent categories. This eliminates many duplicate entries.
For example:
  • In 9.1.6.0 and earlier releases:
    "category": {
        "10001-1-3-10001": {
            "parent": "10001",
            "sequence": "1",
            "path": {
                "name": [
                    "Apparel",
                    "Women",
                    "Dresses"
                ]
                "id": [
                    "1",
                    "3",
                    "100001",
                ]
            },
            "catalog": "10001",
            "name": "Dresses"
        },
        "10502-1-3-10001": {
            "parent": "10001",
            "sequence": "1",
            "path": {
                "name": [
                    "Apparel",
                    "Women",
                    "Dresses"
                ]
                "id": [
                    "1",
                    "3",
                    "10001",
                ]
            },
            "catalog": "10502",
            "name": "Dresses"
        }
        "10502-3074457345616677668-10001": {
            "parent": "10001",
            "sequence": "1",
            "path": {
                "name": [
                    "Hot Buys",
                    "Dresses"
                ]
                "id": [
                    "1",
                    "3",
                    "3074457345616677668",
                ]
            },
            "catalog": "10502",
            "name": "Dresses"
        }
    }
  • In 9.1.7.0 and later releases:
    "category": {
        "10502-10001": {
            "sequence": "1",
            "name": "Dresses",
            "id": "10001"
        },
        "10001-10001": {
            "sequence": "1",
            "name": "Dresses",
            "id": "10001"
        }
    }
    "path_name": {
        "10001": [
            "Women",
            "Dresses",
            "Apparel"
        ]
        "10502": [
            "Women",
            "Dresses",
            "Apparel",
            "Hot Buys"
        ]
    }
attributes In 9.1.7.0 and later releases, the key element is removed. This is due to the fact that it duplicates the values of the id element.
For example:
  • In 9.1.6.0 and earlier releases:
    "attributes": {
        "70000000000000006": {
            "identifier": "occasion",
            "usage": "Descriptive",
            "displayable": true,
            "ribbon": false,
            "merchandisable": false,
            "searchable": false,
            "sequence": 1.0,
            "name": {
                ...
            },
            "facetable": false,
            "id": "70000000000000006",
            "comparable": true,
            "value": [
                ...
            ],
            "key": "70000000000000006",
            "swatchable": false
        }
    }
  • In 9.1.7.0 and later releases:
    "attributes": {
        "70000000000000006": {
            "identifier": "occasion",
            "usage": "Descriptive",
            "displayable": true,
            "ribbon": false,
            "merchandisable": false,
            "searchable": false,
            "sequence": 1.0,
            "name": {
                ...
            },
            "facetable": false,
            "id": "70000000000000006",
            "comparable": true,
            "value": [
                ...
            ],
            "swatchable": false
        }
    }