loading table of contents...

3.4.3.4. Adding New PARENT_PARTNUMBER Field to the Solr Index

Searching IBM WCS catalog assets in CoreMedia Studio is part of the seamless integration experience that CoreMedia DXP 8 brings to the table. Almost all the catalog assets are searchable in CoreMedia DXP 8 without any need of customization except for the catalog product asset which acts as a template for a group of items (or SKUs) that exhibit the same attributes.

This needs an extra property to explicitly define the hierarchical relationship between the product and its variants in order to make the variants also searchable in Studio. This subsection describes all the steps required to introduce the custom CoreMedia Digital Experience Platform 8 parent part number field which establishes the relationship between product and variant in WebSphere Commerce.

  1. Preprocessing data involves querying WebSphere commerce tables and creating a set of temporary tables to hold the data. The file WCDE-INSTALL\components\foundation\samples\dataimport\catalog\oracle\wc-dataimport-preprocess-parent-partnumber.xml in the CoreMedia LiveContext 2.0 WebSphere Commerce Project Workspace defines a custom preprocessing task for this. The file contains the new temporary table definition, database schema metadata, and a reference to the Java class used in the preprocessing steps for an Oracle database.

    Simply copy the file to the corresponding location in your IBM WCS RAD system. The workspace contains files for other databases which you can use similarly.

  2. Add the following new field to the Solr schema in the file WCDE-INSTALL\components\foundation\subcomponents\search\solr\home\template\CatalogEntry\conf\locale\en_US\schema.xml and in the corresponding files for other languages:

    <field name="parent_partNumber_ntk"
              type="wc_keywordTextLowerCase" indexed="true"
              stored="true"  multiValued="false"/>

    Example 3.2. New Solr field


  3. Now, you have to configure data extraction from the relational table. The Data extraction is handled by the data import handler, containing configuration files with predefined SQL query lines that extract WebSphere Commerce data. You have to extend the extraction scope by including parent part number into the SQL statements.

    In the file WCDE-INSTALL\components\foundation\subcomponents\search\solr\home\template\CatalogEntry\conf\database\oracle\wc-data-config.xml (and corresponding files for other databases) you have to adapt some lines. To do so, proceed as follows:

    1. Open the file components\foundation\subcomponents\search\solr\home\template\CatalogEntry\conf\database\oracle\wc-data-config.xml in the CoreMedia LiveContext 2.0 WebSphere Commerce Project Workspace.

    2. In the file, search for all entries that contain the string TI_PARENTCHILDCATENTRY. Copy these lines to the corresponding positions in the wc-data-config.xml file of your WCS RAD workspace.

    3. In the file, search for comments that contain the string CoreMedia and copy the lines surrounded by these comments to the corresponding positions in the wc-data-config.xml file of your WCS RAD workspace.

  4. Rebuild the index as described in the IBM documentation at http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.developer.doc/concepts/csdmanagesearchpopbuild.htm

WebSphere Commerce search contains a scheduler job (UpdateSearchIndex) to synchronice the catalog changes with the search indes. The default update interval is 5 minutes. You can change this default value according to your needs in the WebSphere Commerce Administration Console.