close

Filter

loading table of contents...

Connector for HCL Commerce Manual / Version 2010

Table Of Contents

3.3.5 Adding New CM_SEO_TOKEN Field to the Solr Index

Per default HCL behavior, you cannot distinguish the SEO keyword overridden by a store. If you have overridden the SEO keyword in the store, then you will get multiple SEO keywords in the response, without knowing which SEO keyword belongs to which store. To be able to distinguish the SEO keyword you need to extend the Solr field by adding the custom CM_SEO_TOKEN field in the Solr index. This custom CM_SEO_TOKEN field concatenates the store ID and the SEO keyword.

  1. Add a preprocessing file for CM_SEO_TOKEN field. The file WCDE-INSTALL\components\foundation\samples\dataimport\catalog\oracle\wc-dataimport-preprocess-cm-seo-token.xml in the CoreMedia LiveContext 3 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.

    Copy the file to the corresponding location in your HCL Commerce RAD system. The workspace contains files for other databases which you can use similarly.

  2. Extend the HCL Solr configuration files by including CM_SEO_TOKEN into the SQL statements as follows:

    1. Add the following new field to the HCL x-schema.xml file WCDE-INSTALL\components\foundation\subcomponents\search\solr\home\template\CatalogEntry\conf\x-schema.xml

      <field name="cm_seo_token_ntk"
             type="wc_cmKeywordTextLowerCase" indexed="true"
             stored="true" multiValued="false"/>

      Example 3.4. New CM_SEO_TOKEN Solr field


    2. Add the new field declaration for CM_SEO_TOKEN in the file WCDE-INSTALL\components\foundation\subcomponents\search\solr\home\template\CatalogEntry\conf\x-data-config.xml.

      <field column="CM_SEO_TOKEN"
             name="cm_seo_token_ntk" />

      Example 3.5. New CM_SEO_TOKEN data config field


    3. Extend the query select and the query from for CM_SEO_TOKEN in the file WCDE-INSTALL\components\foundation\subcomponents\search\solr\home\template\CatalogEntry\conf\locale\[LOCALE_NAME]\solrcore.properties where LOCALE_NAME is the locale name of the language that use in the search index.

      dataImporter.ext.querySelect=TI_CM_SEOURL.CM_SEO_TOKEN,
      dataImporter.ext.queryFrom=LEFT OUTER JOIN
         TI_CM_SEOURL_<lang_id> TI_CM_SEOURL ON
         (CATENTRY.CATENTRY_ID=TI_CM_SEOURL.CATENTRY_ID)

      Example 3.6. Extended SQL Query


      where <lang_id> is the language id of the locale.

  3. Rebuild the index as described in the HCL documentation at https://help.hcltechsw.com/commerce/7.0.0/com.ibm.commerce.developer.doc/concepts/csdmanagesearchpopbuild.html

WebSphere Commerce search contains a scheduler job (UpdateSearchIndex) that synchronizes catalog changes with the search index. The default update interval is 5 minutes. You can change the default value in the WebSphere Commerce Administration Console.

Search Results

Table Of Contents