Text Relevance

You can improve search results for your customers by boosting those attributes which are more significant if they contain a search term. Usually these are shorter attributes that are related to fields that customers are likely to search on, such as product name or brand. You can also boost the importance of category attributes, such as category name. For example, if a customer searches on notebook, the results from the notebook category are returned first, and paper products with the word notebook in the title or description are included at the end of the search results.

How Text Relevance Is Determined

When a customer enters a search term, Salesforce B2C Commerce computes a score for each document, based on how many times the search term is found in each searchable attribute, the boosting factor, and other weighting factors. When search results are sorted by text relevance, the score of the document determines the order in which documents are returned in the result set, with the highest score going to the document that is the most relevant to the search.

What affects text relevance:

However, it doesn't matter where in the attribute the search term is found or the length of the term.

For additional information about search scoring, see Search Results Window.

Text Relevance Boosting Factors

If you specify a boosting factor of 1.0, it does not change the score at all, because this is the default value for a boosting factor. The boost factor you specify to calculate text relevance is in relation to the entire index, not the search results returned by a particular query. You can specify a boosting factor under 1.0 if you want to indicate that a specific field is less relevant. You can use any decimal number under 1 (.5, 0.3) to make a field less relevant. You can't use negative numbers to make a field less relevant.

Specifying a boosting factor over 1.0 increases the text relevance of the field, so that including a boosting factor of 2.0 makes the field twice as relevant as it was originally, in relation to all of the other fields of the document.

Generally, you want to boost attributes that contain only information relevant to the product, such as the product name or short description. If you boost fields with more general information, you don't improve the sorting of your search results. For example, if you boost the long description of a product, which includes statements such as "Create an outfit for this shirt by adding our Cargo pants", the item might be boosted ahead of pants, so that you see a mix of pants and shirts when customers search for pants.

Remember that the search score affects the scoring of all items, not just the items in your current result set. It's important to test the effect of any field boosts with various queries to make sure that the boost doesn't have unintended consequences.

Note: Boosting factors are applied to the synonyms of a search term and the search term. For example, if a customer searches on notebook and notebook and laptop are synonyms, then products that are laptops will also appear at the top of the search list.

Testing Boosting Factors

Salesforce recommends that you disable other search sorting rules when testing attribute boosting, so that you can see the effect of the boosts alone. You can use the Storefront Toolkit to see the effect of the boosts you create.