Per default IBM behaviour, 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.
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 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.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.
Add a new field to the Solr schema for the CatalogEntry and for the CatalogGroup as shown in
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="cm_seo_token_ntk" type="wc_cmKeywordTextLowerCase" indexed="true" stored="true" multiValued="false" />
Example 3.3. New CM_SEO_TOKEN Solr field
Configure data extraction from the relational table. 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 CM_SEO_TOKEN 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: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.In the file, search for all entries that contain the string TI_CM_SEOURL. Copy these lines to the corresponding positions in the
wc-data-config.xml
file of your WCS RAD workspace.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.
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) 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.