Extending the WebSphere Commerce search base index schema
The base index schema can be extended to suit your business needs. For example, to separate data into different indexes that are based on their refresh intervals.
It can be extended by creating a new separate index schema and linking it to the base index. In some cases, it is more desirable to separate data into different indexes. In this scenario, you create a new separate index schema and link it to the base index.
For example, the product base index is used to store static data for the product, such as product identifier, name, and short description. These values typically do not change often. However, dynamic information such as product inventory or ratings change more frequently. Therefore, it is put into a separate index, where it can be refreshed at different intervals than the base product index.
- The extension index artifacts must be created first, and placed
in a specific directory under the deployed Solr home directory. The
extension index schema structure is defined in the Solr schema.xml configuration
file.
For the base index to be able to reference an extension index, the extension index schema must define what is similar to a foreign key that matches the unique field name and type in the base index schema. The referenced field data type must be a simple data type such as String, Integer, or float. It must match the unique key name and type of the base index.
Avoid common field names between extension indexes and the base index, other than the referenced field. It is recommended to use a naming convention that prefixes the extension index fields to avoid naming collisions.
- The extension index cores must be registered under the solr.xml file, as the Solr server loads indexes registered under the solr.xml file. This file also contains the mapping between the base index and extension index.
- The extension index must be registered in the WebSphere Commerce database. The WebSphere Commerce run time looks up all Solr indexes that are registered in the SRCHCONFEXT table. Extension indexes are registered as index subtypes of the base index.
Procedure
What to do next
To work with an inventory index in WebSphere Commerce search, complete the following tutorial: Tutorial: Indexing external inventory data in WebSphere Commerce search.