Example: Facet data

You can insert facet data into the FACET, FACETDESC and FACETGRP database tables, or replace or delete it, using the Data Load utility. These examples use CSV files to demonstrate how to insert, replace, or delete the data.

This example uses a CSV file to demonstrate how to insert, replace, or delete your data. You can also create and use an XML formatted file to insert, replace, or delete your data. If you choose to create and use an XML formatted file, ensure that your XML elements use the same names as are used for CSV column names.

CSV column and XML element definitions for facet.csv

storeentId
(Integer) The store entity ID. It is optional. If you leave it blank, the default value will be the storeId defined in the business context in the wc-dataload-env.xml. It is mapped to FACET.STOREENT_ID.
searchAttributeIdentifier
(Required, String) The search attribute identifier. It is mapped to SRCHATTR.IDENTIFIER.
indexScope
(Long) The index scope for the search attribute. It is optional. If you leave it blank, the default value will be the catalogId defined in the business context in the wc-dataload-env.xml. It is mapped to SRCHATTR.INDEXSCOPE.
indexType
(Required, String) The type of search index. It is mapped to SRCHATTR.INDEXTYPE. These three columns (searchAttributeIdentifier, indexScope, indexType) will be used to resolve the SRCHATTR_ID column in the FACET table. The first four CSV columns are used to resolve the FACET_ID in the FACET table.
attributeIdentifier
(String) The attribute dictionary attribute identifier. It is mapped to ATTR.IDENTIFIER. It is used to resolve the ATTR_ID column in the FACET table.
selection
(Integer) Describes whether the facetable attribute will be allowed to have multiple selections. It is mapped to FACET.SELECTION.
sortOrder
(Integer) The display order to use when displaying the values for the facet. It is mapped to FACET.SORT_ORDER.
keywordSearch
(Integer) Describes whether the facet should be included in the keyword search. It is mapped to FACET.KEYWORD_SEARCH.
zeroDisplay
(Integer) Describes whether the facetable attribute should display zero count values. It is mapped to FACET.ZERO_DISPLAY.
maxDisplay
(Integer) The maximum values to display in the storefront for the facet. It is mapped to FACET.MAX_DISPLAY.
sequence
(Double) The sequence of the facet showing in the storefront. It is mapped to FACET.SEQUENCE.
groupId
(Long) The group id for the facet. It is mapped to FACET.GROUP_ID.
name
(Required, String) The language sensitive name for a non-attribute based facet. It is mapped to FACETDESC.NAME.
description
(String) The language sensitive administrative description for a non-attribute based facet. It is mapped to FACETDESC.DESCRIPTION.
delete
(String) A flag indicating whether to delete. Specify 1 to delete the row.

CSV file with sample facet data

In this example the data source is a CSV file. The file contains sample facet data: that is loaded into the FACET and FACETDESC tables: CSV file with sample facet data.

Formatted CSV file with column headings
storeentId searchAttributeIdentifier indexScope indexType attributeIdentifier selection sortOrder keywordSearch zeroDisplay maxDisplay sequence groupId name description delete
_cat.Color CatalogEntry Color 1 0 0 0 20 1 0 Color Color 0
0 _cat.ManufacturerName 0 CatalogEntry 1 1 1 0 6 0 0 Brand The manufacturer 0

CSV column and XML element definitions for FacetCatalogGroup.csv

storeentId
(Integer) The store entity ID. It is optional. If you leave it blank, the default value will be the storeId defined in the business context in the wc-dataload-env.xml. It is mapped to FACET.STOREENT_ID
searchAttributeIdentifier
(Required, String) The search attribute identifier. It is mapped to SRCHATTR.IDENTIFIER.
indexScope
(Long) The index scope for the search attribute. It is optional. If you leave it blank, the default value will be the catalogId defined in the business context in the wc-dataload-env.xml. It is mapped to SRCHATTR.INDEXSCOPE.
indexType
(Required, String) The type of search index. It is mapped to SRCHATTR.INDEXTYPE. These three columns (searchAttributeIdentifier, indexScope, indexType) will be used to resolve the SRCHATTR_ID column in the FACET table. The first four CSV columns are used to resolve the FACET_ID in the FACETCATGRP table.
catalogGroupIdentifier
(Required, String) The catalog group identifier. It is mapped to CATGROUP.IDENTIFIER. It is used to resolve to the CATGROUP_ID in the FACETCATGRP table.
sequence
(Double) The sequence of the facet showing in the storefront. It is mapped to FACETCATGRP.SEQUENCE.
displayable
(Integer) Describes whether the facet is displayable. It is mapped to FACETCATGRP.DISPLAYABLE.
delete
(String) A flag indicating whether to delete. Specify 1 to delete the row.

CSV file with sample facet data

In this example the data source is a CSV file. The file contains sample facet data: that is loaded into the FACETCATGRP tables: CSV file with sample facet data.

storeentId searchAttributeIdentifier indexScope indexType catalogGroupIdentifier sequence displayable delete
0 _cat.ParentCatalogGroup 0 CatalogEntry LivingRoomFurniture 1 0 0
_cat.Color CatalogEntry LivingRoomLighting 2 1 0

CSV column and XML element definitions for FacetDescription.csv

FacetDescription.csv is loaded to the FACETDESC tables. The description for the default language is already loaded with Facet.csv. FacetDescription.csv is used to load additional languages the store supported. The following are descriptions for each of the columns:
storeentId
(Integer) The store entity ID. It is optional. If you leave it blank, the default value will be the storeId defined in the business context in the wc-dataload-env.xml. It is mapped to FACET.STOREENT_ID.
searchAttributeIdentifier
(Required, String) The search attribute identifier. It is mapped to SRCHATTR.IDENTIFIER.
indexScope
(Long) The index scope for the search attribute. It is optional. If you leave it blank, the default value will be the catalogId defined in the business context in the wc-dataload-env.xml. It is mapped to SRCHATTR.INDEXSCOPE.
indexType
(Required, String) The type of search index. It is mapped to SRCHATTR.INDEXTYPE. These three columns (searchAttributeIdentifier, indexScope, indexType) will be used to resolve the SRCHATTR_ID column in the FACET table. The first four CSV columns are used to resolve the FACET_ID in the FACETDESC table.
languageId
(Integer) The language ID, It is optional. If you leave it blank, the default value will be the langId defined in the business context in the wc-dataload-env.xml.
name
(Required, String) The language sensitive name for a non-attribute based facet. It is mapped to FACETDESC.NAME.
description
(String) The language sensitive administrative description for a non-attribute based facet. It is mapped to FACETDESC.DESCRIPTION.
delete
(String) A flag indicating whether to delete. Specify 1 to delete the row.

CSV file with sample facet data

In this example the data source is a CSV file. The file contains sample facet data: that is loaded into the FACETDESC tables: CSV file with sample facet data.

storeentId searchAttributeIdentifier indexScope indexType languageId name description delete
0 _cat.ManufacturerName 0 CatalogEntry -1 Brand The manufacturer 0
0 _cat.ManufacturerName 0 CatalogEntry -2 Marque Le fabriquant 0