Introduced in Feature Pack 2

Customizing the Madisons starter store search for the new search profile

Introduced in Feature Pack 2

In this lesson, the Madisons starter store is modified to take advantage of the newly created search profile.

This tutorial only extends the IBM_findCatalogEntryByNameAndShortDescription profile in the wc-search.xml file. For more information on other profiles in the wc-search.xml file that you can extend and the effects of changing these profiles, see WebSphere Commerce search configuration file (wc-search.xml) (WC EAR). For more information about making changes to extend these profiles, see Changing properties in the search configuration file (wc-search.xml) (WC EAR).

Procedure

  1. Open the following file:
    • Stores/WebContent/Madisons/Snippets/Search/SearchSetup.jspf
  2. Modify the following sections with the changes marked in bold:
    <c:if test="${!errorMinPriceFlag && !errorMaxPriceFlag}">
    <c:choose>
    <c:when test="${WCParam.searchTermScope == 3}">
    <c:set var="navigationView" value="getCatalogNavigationAttachmentView" scope="request"/>
    <c:set var="searchProfile" value="IBM_findCatalogEntryByUnstructureField" scope="request"/>
    </c:when>
    <c:when test="${WCParam.searchTermScope == 2}">
    <c:set var="navigationView" value="getCatalogNavigationView" scope="request"/>
    <c:set var="searchProfile" value="IBM_findCatalogEntryByName" scope="request"/>
    </c:when>
    <c:otherwise>
    <c:set var="navigationView" value="getCatalogNavigationView" scope="request"/>
    <c:set var="searchProfile" value="X_findCatalogEntryByWarranty" scope="request"/>
    </c:otherwise>
    </c:choose>
    <c:choose>
    <c:when test="${pageView == 'detailed' and searchProfile == 'X_findCatalogEntryByWarranty'}">
    <c:set var="navigationView" value="getCatalogNavigationView" scope="request"/>
    <c:set var="searchProfile" value="IBM_findCatalogEntryByNameAndShortDescriptionInDetail" scope="request"/>
    </c:when>
    </c:choose>
    <wcf:getData type="com.ibm.commerce.catalog.facade.datatypes.CatalogNavigationViewType" var="catalogNavigationView"
    expressionBuilder="${navigationView}" scope="request" varShowVerb="showCatalogNavigationView"
    maxItems="${pageSize}" recordSetStartNumber="${WCParam.beginIndex}" scope="request">
    <wcf:param name="searchProfile" value="${searchProfile}" />
    <wcf:param name="searchTerm" value="${WCParam.searchTerm}" />
    <wcf:param name="searchType" value="${searchType}" />
    <wcf:param name="metaData" value="${WCParam.metaData}" />
    <wcf:param name="orderBy" value="${WCParam.orderBy}" />
    <wcf:param name="facet" value="${WCParam.facet}" />
  3. Save your changes and close the file.

Results