Out of the Box, Search rules only work when you type a search term into the storefront. If you are simply clicking around different categories/facets (called 'category navigation'), search rules will not trigger. We use sequencing/sorting only for category navigation, by default
You can use the below steps as an example to get search rules working for category navigation:
1) Modify the getCatalogNavigationView expressionProvider in the get-data-config.xml. Pass in a '*' into the _wcf.search.term parameter as follows:
The get-data-config.xml is in the directory:
<AppServer directory>/profiles/<profile name>/installedApps/WC_<profile>_cell/WC_<profile>.ear/Stores.war/WEB-INF/config/com.ibm.commerce.catalog-fep/get-data-config.xml
Passing in the '*' like this will make the searchTerm value default to '*', if no other value has been specified from the storefront.
(The screenshot is updating the getCatalogNavigationView, you might instead need to update getCatalogNavigationViewbyCategory, depending on which ExpressionBuilder you use)
2) Remove the '*' from the prohibited list of search terms in the wc-component.xml:
The wc-component.xml is in the directory:
<AppServer directory>/profiles/<profile name>/installedApps/WC_<profile>_cell/WC_<profile>.ear/xml/config/com.ibm.commerce.catalog-fep/wc-component.xml
3) Build your search rule, for example:
4) As shown in the above screenshot, make sure to make the keyword '*':
If implementing this customization, testing should be done on the storefront after to make sure the search rules is influencing the results as expected.
If you are in fep6, update the wc-component.xml under the xml\config\com.ibm.commerce.catalog-fep directory by commenting out the following line:
<_config:property name="IgnoreLeadingPatterns" value="[\\*\\?]+"/>