Customizing HCL Commerce Search in the storefront

You can customize HCL Commerce Search in the storefront to suit your business needs. You can customize HCL Commerce Search according to your role within the WebSphere Commerce site.

Search requests are typically initiated from the storefront. The most important parameter that is specified when you are initiating a search request is the search profile. A search profile can be passed to the HCL Commerce Search runtime by adding it as a parameter in the wcf:rest tag.

Depending on where the custom search profile is called in the storefront, different JSP widgets must be updated.

Procedure

  1. Update the SearchSetup.jspf file in the common directory of your store:
    • workspace_dir\Stores\WebContent\widgetdir\Common
  2. Replace IBM_findProductsBySearchTerm by the custom search profile X_findCatalogEntryByfield1.
    Important: The custom profile should extend the profile that is being replaced in this step to avoid losing any settings from the previous profile.

    Index fields that are mapped to the CatalogEntryView user data fields can be displayed in the storefront by modifying the JSP file.

    To display the CatalogEntry customizable fields, field3, and field5, they can be displayed in the CatalogEntry widget:
    
    <c:out value="Custom field3: ${catalogEntryView.UserData.field3}" />
    <c:out value="Custom field5: ${catalogEntryView.UserData.field5}" />