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
-
In a file manager utility, go to the following directory.
- solrhome\MC_masterCatalogID\locale\CatalogEntry\conf
For example, solrhome\MC_10001\en_US\CatalogEntry\conf - Open the solrcore.properties file for editing.
-
Uncomment the
dataImporter.ext.querySelect
property and set the value for the property to beTI_RATING.RATING
. -
Uncomment the
dataImporter.ext.queryFrom
property and set the value for the property to be the following value.
This value is appended to the origianl query that is defined in the wc-data-config.xml file.LEFT OUTER JOIN TI_RATING ON (CATENTRY.CATENTRY_ID=TI_RATING.CATENTRY_ID)
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)
- Save and close the file.
- Open the x-data-config.xml file for editing.
-
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"/>
- Save and close the file.