Migration guide for Solr search profiles to Orchestration extended search profiles
This guide provides a high-level overview of how existing Solr customers can migrate their customizations to leverage the new Orchestration extended search profiles.
The default v2 endpoints in Orchestration map to specific v1 Solr extended search profiles,
are as follow:
ES v2 Search Profile | Solr v1 Extended Search Profile |
---|---|
HCL_findNavigationSuggestion_Products | IBM_findNavigationSuggestion_Products |
HCL_findNavigationSuggestion_PartNumber | IBM_findNavigationSuggestion_PartNumber |
HCL_findNavigationSuggestion_Brands | IBM_findNavigationSuggestion_Brands |
HCL_findNavigationSuggestion_Categories | IBM_findNavigationSuggestion_Categories |
HCL_findNavigationSuggestion_Keywords | IBM_findNavigationSuggestion_Keywords |
HCL_V2_findCategoryByUniqueIds | HCL_findCategoryByUniqueIds_extended |
HCL_V2_findCategoryByIdentifier | HCL_findCategoryByIdentifier_extended |
HCL_V2_findSubCategories | HCL_findSubCategories_extended |
HCL_V2_findProductByPartNumber_Details | HCL_findProductByPartNumber_Details_extended |
HCL_V2_findProductsByCategory | HCL_findProductsByCategory_extended |
HCL_V2_findProductsBySearchTerm | HCL_findProductsBySearchTerm_extended |
HCL_V2_findProductByIds_Details | HCL_findProductByIds_Details_extended |
HCL_V2_findProductsBySearchTermWithPrice | HCL_findProductsBySearchTerm_extended |
HCL_V2_findProductsByCategoryWithPriceRange | HCL_findProductsByCategory_extended |
Mapping Explanation
The Ruby storefront's v2 endpoint profiles are mapped to Solr's extended v1 endpoint search profiles. For example, when Ruby calls the endpoint HCL_V2_findProductsBySearchTermWithPrice, Orchestration maps this profile name to HCL_findProductsBySearchTerm_extended. This extended profile is based on the existing Solr profile IBM_findProductsBySearchTerm, with additional tweaks and fields to make the response compatible with v2.
- Mapping File Locations
- Orchestration Service Mapping File
- elastic-solr-route/src/main/resources/endpoint-mapping/es-solr-profile-mapping.properties holds all ES v2 profile mappings.
- Orchestration Service Configuration JSON
- elastic-solr-route/src/main/resources/endpoint-mapping/endpoint-mapping-configuration.json holds the default profile used with the endpoints on the Orchestration service layer.
- Solr Endpoint Mapping File
- /server/root/resources/search/runtime/config/com.ibm.commerce.rest/wc-rest-resourceconfig.xml contains the same configuration in the existing Solr application.
Example mapping for V2-Product-Resource by
searchTerm with default search profile
HCL_findProductsBySearchTerm_extended in Orchestration
service:
"product-view-by-search-term-route": {
"pre-processor": [
"com.hcl.commerce.orchestration.service.preprocessor.ProductsRestPreProcessor"
],
"post-processor": [
"com.hcl.commerce.orchestration.service.jolttransformation.V1ResponseTransform",
"com.hcl.commerce.orchestration.service.postprocessor.V2ProductsNavigationLinksProcessor"
],
"jolt-spec": "/jolt-scripts/V2-product-spec.json",
"service-url-pattern": "store/{storeId}/productview/bySearchTerm",
"service-profile-name": "HCL_findProductsBySearchTerm_extended"
}
Migration Steps
- Create a New File
- Create a new file named wc-search.xml in the directory /profile/resources/search/runtime/config/com.ibm.commerce.search-ext.
- Copy Content from Existing Profile
- Copy the content of the profile from com.ibm.commerce.search/wc-search.xml,for example, HCL_findProductsBySearchTerm_extended.
- Modify the Profile
- Add the required fields in the result section of com.ibm.commerce.search-ext/wc-search.xml.
For
example:
<_config:profile name="HCL_findProductsBySearchTerm_extended" indexName="CatalogEntry">
...
<_config:result>
<!-- Keep the existing fields from the original profile and add the required custom fields -->
<_config:field name="X_some_custom_field" />
</_config:result>
...
</_config:profile>
Tips and Hints
- Avoid Direct Modifications
- Extend from the provided profiles instead of directly updating them to avoid conflicts during future upgrades.
- Custom Data Integration
- Any custom data can be returned with the response through Orchestration and will be available for the Storefront application to consume.
Related Documentation
For more detailed information on search profiles, refer to the Search Profiles Guide.