Tutorial: Indexing external data in WebSphere Commerce search
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.
- Preprocessing, where the highly structured relational data is flattened and stored in summary tables.
- 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.
Learning objectives
- Indexing
- 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:- BOM configuration changes as used in the tutorial: Tutorial: Extending a BOD service to manage UserData with the Data Service layer. You are not required to complete this tutorial as a prerequisite, but ensure that you understand the concepts and tasks that are contained in the tutorial.
- WebSphere Commerce search
- Web services
- XML
- WebSphere Commerce services
- Relational databases
- SQL