Extend 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: We 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. Custom fields that use the X_ prefix expect to find a corresponding field type defined in x-schema.xml. If you customize user data with X_* field in wc-data-preprocess-x-finalbuild.xml, ensure that you first define the field type with x_* in x-schema.xml.

    2. Any data mapping customization to x-data-config.xml must not begin with X_.

  3. Save our 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="X_NAME" name="x_name"  /> 
      <field column="X_SHORTDESCRIPTION" name="x_shortDescription" />

  6. Save our changes and close the file.

  7. Restart the search server and fully preprocess and build the search index.