Configuring 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 your 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 your environment. If you want to add the fields for more catalogs or languages, you must repeat the following process for those catalogs and languages.

Procedure

  1. In a file manager utility, go to the following directory.
    • solrhome\MC_masterCatalogID\locale\CatalogEntry\conf
    The MC_masterCatalogID folder includes the configurations files for each language.
    For example, solrhome\MC_10001\en_US\CatalogEntry\conf
  2. Open the solrcore.properties file for editing.
  3. Uncomment the dataImporter.ext.querySelect property and set the value for the property to be TI_RATING.RATING.
  4. Uncomment the dataImporter.ext.queryFrom property and set the value for the property to be the following value.
    LEFT OUTER JOIN TI_RATING ON (CATENTRY.CATENTRY_ID=TI_RATING.CATENTRY_ID)
    This value is appended to the origianl query that is defined in the wc-data-config.xml file.
    For example, the content of your properties file can resemble the following code snippet.
    
    # solrcore.properties
    dataImporter.ext.querySelect=TI_RATING.RATING,
    dataImporter.ext.queryFrom=LEFT OUTER JOIN TI_RATING ON (CATENTRY.CATENTRY_ID=TI_RATING.CATENTRY_ID)
  5. Save and close the file.
  6. 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.