< Previous | Next >

Configure the Data Import Handler mapping

In this lesson, you extract the data for the custom fields from the temporary relational table in the search schema. The data extraction is handled by the Data Import Handler, which uses configuration files that include predefined SQL query lines that extract WebSphere Commerce data. To extend the extraction scope, you append queries for the customer ratings data to the files for the handler.

Note: During this task, you add fields for the master catalog. As an example, this tutorial uses a master catalog with an ID of "10001" and uses the locale "en_US". Change the values to reflect the values for the environment. To add the fields for more catalogs or languages, we must repeat the following process for those catalogs and languages.


Procedure

  1. In a file manager utility, go to the following directory.

    The MC_masterCatalogID folder includes the configurations files for each language. For example, solrhome\MC_10001\en_US\CatalogEntry\conf

  2. Open the file wc-dataimport-preprocess-x-finalbuild.xml for editing.

  3. Add "TI_RATING.RATING" using a select query and "LEFT OUTER JOIN TI_RATING ON (CATENTRY.CATENTRY_ID=TI_RATING.CATENTRY_ID" using a from query for "CREATE VIEW X_VI_CE_#INDEX_SCOPE_TAG#_#lang_tag#"

  4. The final SQL should be something like the following:

      <_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, 
      TI_RATING.RATING, CATENTDESCOVR.FIELD3 X_FIELD3_NL_S 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 TI_RATING ON (CATENTRY.CATENTRY_ID=TI_RATING.CATENTRY_ID))" 
      name="X_VI_CE_#INDEX_SCOPE_TAG#_#lang_tag#"/>

  5. Save and close the file.

  6. Change to the search-config-ext\src\index\managed-solr\config\v3\CatalogEntry directory, and open the x-data-config.xml file for editing.

  7. Add the following field declaration mappings to map the field from the database to the index field that defined in the x-schema.xml file.

      <field column="RATING" name="customerRanking"/>

  8. Save and close the file.

< Previous | Next >