Search relevancy scores

Whether you tune search results for search relevancy or search merchandising purposes, you are working with their relevancy scores.

Search results are ordered by the relevancy scores of products or documents by default, from the most relevant matches to the least relevant matches.

You can view the relevancy score of catalog entries in store preview with HCL Commerce Search. The relevancy score is displayed in search results in the following form:
  • [Relevancy score: relevancy_score] product_name
    For example:
    Relevancy score in the Aurora starter store

Alternatively, you can view relevancy scores outside store preview by checking the trace.log log file for each document that is returned. Or you can specify debugQuery=true in the query URL in a web browser and observing the response.

HCL Commerce Search calculates relevancy scores by default by using several factors, including:

Calculating relevancy scores by using the Lucene scoring model

The Lucene scoring model is also known as the tf-idf model. It involves a number of scoring factors:
Term Frequency
The number of times that a term appears in a document.
Given a search query, the higher the term frequency, the higher the document score.
Inverse Document Frequency
The rarer a term is across all documents in the index, the higher its contribution is to the score.
Coordination Factor
The more query terms that are found in a document, the higher its score.
Field length
The more words that a field contains, the lower its score.
This factor penalizes documents with longer field values. That is, search hits on short index fields score higher than search hits on long index fields.
Index-time boost
If a boost is specified for a document at index-time, scores for searches that match that document are boosted.
Note: HCL Commerce does not use index-time boosting, as it requires a full reindexing of the catalog.
Query clause boost
A user can explicitly boost the contribution of one part of a query over another.
HCL Commerce Search relevancy boosts
HCL Commerce Search relevancy boosts use query time boosts for specific indexed fields when constructing a search query.
Search term associations and search rules in the Management Center
Business users can use the Management Center tools to influence relevancy scores and search results in starter stores.
Search term associations and search rules in the Management Center use query time boosts for specific indexed fields when constructing a search query.
Descriptive catalog information to boost relevancy
Business users can use the Management Center tools to update the existing catalog information to be more descriptive.
Relevant descriptive labels and attributes ensure that products are searchable by shoppers in the storefront. These tags can improve the overall accuracy of the relevancy score during keyword searches.
Synonyms can then improve the relevancy of general search terms, such as paper, jeans, or dress, so that they can be refined or associated with more descriptive information about the products to be merchandised based on your business needs.

Boosting relevancy scores

Site administrators can increase relevancy scores, for example, by changing the relevancy of search index fields, since depending on your store catalog, some search index fields might be more relevant than others for when shoppers search in the store.

Business users can increase relevancy scores, for example, by working with search term associations and search rules in the Management Center. These changes use query time boosts for specific indexed fields when constructing a search query.

Example

When you view the relevancy scores of the following products in the Aurora starter store:
  • Red Delicious Apples
  • Crispin Apples
The following search results are displayed when you search for red apple in the storefront:
Search results

Where the search results are displayed in the order of their relevancy, with red delicious apples displayed first.

In store preview, the search results page displays the relevancy scores after you click Show Page Information, showing why the search results are ordered in this way to the shopper:
Search results in store preview