Enabling search rules for category navigation
You can create search rules that make it easier for the customer to browse the storefront by category.
About this task
You are not limited to using product names in search rules. By editing two configuration files, you can enable search rules for category navigation as well.
Procedure
-
Edit the file CategoryNavigationSetup.jspf. Update the
searchTerm parameter to the value "
<nav>
".<wcf:rest var="catalogNavigationView1" url="${searchHostNamePath}${searchContextPath}/store/${WCParam.storeId}/productview/byCategory/${WCParam.categoryId}" > <wcf:param name="pageSize" value="${pageSize}" /> <wcf:param name="pageNumber" value="${pageNum + 1}" /> <wcf:param name="searchProfile" value="${searchProfile}" /> <wcf:param name="searchTerm" value="<nav>" />
-
Update wc-search.xml to use the class
SolrRESTSearchBasedMerchandisingExpressionProvider in the
IBM_findProductsByCategory profile.
<_config:profile name="IBM_findProductsByCategory" indexName="CatalogEntry"> <_config:query> <!-- The search profile used to Dynamic Kit pre-configuration Data but with no price. --> <_config:param name="DynamicKitReturnPrice" value="true"/> <_config:provider classname="com.ibm.commerce.foundation.server.services.rest.search.expression.solr.SolrRESTSearchByCategoryExpressionProvider"/> <_config:provider classname="com.ibm.commerce.foundation.server.services.rest.search.expression.solr.SolrRESTSearchByManufacturerExpressionProvider"/> <_config:provider classname="com.ibm.commerce.foundation.server.services.rest.search.expression.solr.SolrRESTSearchByPriceExpressionProvider"/> <_config:provider classname="com.ibm.commerce.foundation.server.services.rest.search.expression.solr.SolrRESTSearchByFacetExpressionProvider"/> <_config:provider classname="com.ibm.commerce.foundation.server.services.rest.search.expression.solr.SolrRESTSearchByStorePathExpressionProvider"/> <_config:provider classname="com.ibm.commerce.foundation.server.services.rest.search.expression.solr.SolrRESTSearchByPublishedEntryOnlyExpressionProvider"/> <_config:provider classname="com.ibm.commerce.foundation.server.services.rest.search.expression.solr.SolrRESTSearchByCustomExpressionProvider"/> <_config:provider classname="com.ibm.commerce.foundation.server.services.rest.search.expression.solr.SolrRESTSearchFacetConditionExpressionProvider"/> <_config:provider classname="com.ibm.commerce.foundation.server.services.rest.search.expression.solr.SolrRESTSearchTypeExpressionProvider"/> <_config:provider classname="com.ibm.commerce.foundation.server.services.rest.search.expression.solr.SolrRESTSearchProductSequencingExpressionProvider"/> <_config:provider classname="com.ibm.commerce.foundation.server.services.rest.search.expression.solr.SolrRESTSearchProductEntitlementExpressionProvider"/> <_config:provider classname="com.ibm.commerce.foundation.server.services.rest.search.expression.solr.SolrRESTSearchBasedMerchandisingExpressionProvider"/>
-
Create a search rule that uses "
<nav>
" as the search term. For more information about creating search rules, see Working with search rules. - View the category in the storefront. For examples, see Categories.