Question
How can I boost the overall relevancy of my search results based on the search term(s) provided?
Answer
Out of the box, search results can be boosted by leveraging a search rule. However, this requires some specific matching criteria or keywords to configure. With the configuration described below, you can boost the overall relevancy of all search results.
To do this, locate the following file:
WC_eardir/Stores.war/WEB-INF/config/com.ibm.commerce.catalog-fep/get-data-config.xml
Find the section containing the IBM_findCatalogEntryByNameAndShortDescription search profile. This is the profile typically used by the default JSP's. If you have customized your JSP's to use a different expression builder, you will need to locate that entry instead.
In the expression-template section, add the following setting after the last _wcf parameter:
_wcf.search.internal.boostquery='name:$searchTerm$^1000'
This will apply boosting to the search profile for the searchTerm parameter, in this example, by a factor of 1000. Also note in this instance we are boosting the 'name' field, but other fields can be boosted as well, such as shortDescription, depending on the type of granularity you are trying to achieve. Restart the server after making the change.
WC_eardir/Stores.war/WEB-INF/config/com.ibm.commerce.catalog-fep/get-data-config.xml
Find the section containing the IBM_findCatalogEntryByNameAndShortDescription search profile. This is the profile typically used by the default JSP's. If you have customized your JSP's to use a different expression builder, you will need to locate that entry instead.
In the expression-template section, add the following setting after the last _wcf parameter:
_wcf.search.internal.boostquery='name:$searchTerm$^1000'
This will apply boosting to the search profile for the searchTerm parameter, in this example, by a factor of 1000. Also note in this instance we are boosting the 'name' field, but other fields can be boosted as well, such as shortDescription, depending on the type of granularity you are trying to achieve. Restart the server after making the change.
No comments:
Post a Comment