Extending the wc-data-config.xml file using the wc-data-preprocess-x-finalbuild.xml file

The wc-data-config.xml file defines the default indexing queries, and the corresponding field mapping between the database column names and the index field names.

Note: You cannot directly modify or extend the wc-data-config.xml file. Instead, the default queries can be extended in the wc-data-preprocess-x-finalbuild.xml file, and field declaration mappings can be extended using the x-data-config.xml file.

Procedure

  1. Open the wc-data-preprocess-x-finalbuild.xml file for editing.
  2. Add the following generic properties inside the file's view definition. These properties are applicable to all of the default queries.
    <_config:data-processing-config processor="com.ibm.commerce.foundation.dataimport.preprocess.FinalViewDataPreProcessor" fetchSize="500" batchSize="500">
    <_config:table definition="CREATE VIEW X_VI_CE_#INDEX_SCOPE_TAG#_#lang_tag# AS(
    SELECT
    CATENTRY.CATENTRY_ID PK,
    CATENTRY.FIELD1 X_FIELD1_I,
    CATENTRY.FIELD2 X_FIELD2_I,
    CATENTRY.FIELD3 X_FIELD3_D,
    CATENTRY.FIELD4 X_FIELD4_Q,
    CATENTRY.FIELD5 X_FIELD5_SM,
    CATENTDESCOVR.FIELD1 X_FIELD1_NL_I,
    CATENTDESCOVR.FIELD2 X_FIELD2_NL_Q,
    CATENTDESCOVR.FIELD3 X_FIELD3_NL_S
    X_CATENTDESC.NAME X_NAME,
    X_CATENTDESC.SHORTDESCRIPTION X_SHORTDESCRIPTION
    FROM CATENTRY
    INNER JOIN TI_CATENTRY_#INDEX_SCOPE_TAG# CE ON (CATENTRY.CATENTRY_ID=CE.CATENTRY_ID)
    LEFT OUTER JOIN CATENTDESCOVR ON (CATENTRY.CATENTRY_ID=CATENTDESCOVR.CATENTRY_ID)
    LEFT OUTER JOIN CATENTDESC X_CATENTDESC ON (X_CATENTDESC.CATENTRY_ID=CATENTRY.CATENTRY_ID AND X_CATENTDESC.LANGUAGE_ID=-1))"
    name="X_VI_CE_#INDEX_SCOPE_TAG#_#lang_tag#"/>
    <_config:query sql="SELECT 1 CATENTRY_ID FROM CATENTRY WHERE 1=-1"/><_config:mapping>
    <_config:key queryColumn="PK" tableColumn="PK"/>
    </_config:mapping>
    </_config:data-processing-config>
    Note:
    1. When the column name beings with X_ and matches the field name, you do not need to define the mapping in the x-data-config.xml.
    2. If the column name and field name cannot be matched, for example:
      
      <field column="X_SHORTDESCRIPTION" name="x_shortDescription_ntk_cs" />
      The column name should not start with X_, as this mapping will be ignored. Change the column name to anything else starting with X but not with X_ , for example;
      <field column="XC_SHORTDESCRIPTION" name="x_shortDescription_ntk_cs" /> 
  3. Save your changes and close the file.
  4. Open the MC_masterCatalogId/en_US/CatalogEntry/conf/x-data-config.xml file for editing.
  5. Define database column-to-index-field mappings in the x-data-config.xml file.
    For example:
    
    <field column="XC_NAME" name="x_name" />
    <field column="XC_SHORTDESCRIPTION" name="x_shortDescription" />
  6. Save your changes and close the file.
  7. Restart the search server and fully preprocess and build the search index.