Introduced in Feature Pack 2

Tutorial: Indexing external data in WebSphere Commerce search

Introduced in Feature Pack 2

In this tutorial, you add the ability to index data from a source external to the WebSphere Commerce database. You then add Management Center support for ranking product search results based on the indexed data. In this tutorial, your external source data is customer ranking of products.

Through customization of the indexing process, you add data to the search index which enable searching on the ranked data. Newly added search fields are used as ranking fields to sort the search results when you create your search rules. Search rules provide ways to manipulate the ordering and ranking of search results in starter stores, where the new ranking field is used as a sort criteria.

Note: Some extensions that are used in this tutorial contain an X_ prefix. This naming convention prevents naming conflicts between customization properties and default WebSphere Commerce properties.
The indexing process in WebSphere Commerce search is divided into two stages:
  1. Preprocessing, where the highly structured relational data is flattened and stored in summary tables.
  2. The actual indexing, where data is extracted from the flattened tables and sent to the Solr indexes.

This two-stage process provides a customization point that allows external data to be added to the index during the preprocessing stage. To configure the preprocessing stage, you use the preprocessing configuration extensions to create temporary tables to hold the external ranking data, which is used in the full index build. You must create the Java extension classes for loading the ranking data from the XML file that contains the externally sourced data into the temporary tables.

You must customize the index building process to include data from the temporary tables into the search index. To customize this process, you configure the DIH configuration file to associate the new table data with the existing data before indexing. Once the indexing process is customized to include the external ranking data in the search index, you add support for using the ranking data in a sorting filter in the Management Center. To add the support, you modify Management Center object definition files.

To display the ranking data in the storefront and use it in the sorting filter, the new ranking field must be added to the mediator configuration file. You configure the new ranking field to map the fields into the UserData within the CatalogNavigationViewType noun, the noun that is used for search results. With the mapping complete, the fields can be extracted and displayed in the Madisons starter store.

The following diagram illustrates this process:
Ratings tutorial process diagram
Note: Workspaces are not supported when you are completing this tutorial.

Learning objectives

After completing this tutorial, you should be familiar with the following concepts:
  • Indexing
After completing this tutorial, you should be able to perform the following tasks:
  • Understand and customize WebSphere Commerce search
  • Understand and customize the preprocessing and indexing process

Time required

Expect this tutorial to take 2 hours to complete. The tutorial can take longer if you explore concepts that are related to this tutorial.

Skill level

This tutorial is intended for advanced WebSphere Commerce developers responsible for creating and customizing WebSphere Commerce BOD services. To complete this tutorial, you should be familiar with the following terms and concepts:

System requirements

Before you begin this tutorial, ensure that you complete the following tasks:

Tutorial resources

The following tutorial resources are available as the test assets used in this tutorial: