Query-time expansion algorithm

If your site uses both the Solr minimum match feature and search term associations, consider using the query-time expansion algorithm. When the site uses search term associations, the query length is altered. Minimum match uses the query length to limit the number of products that are returned so it is possible that no products are returned. The query expansion algorithm helps ensure that relevant results are displayed. You can fine-tune the result set by setting one of three options.

Here's a simple example to illustrate. This example assumes that the minimum match value is 2.

Set up Search term associations Shopper's query Search result
Default WebSphere Commerce Search behavior Synonym:cup, teacup, mug mug No results are returned.

The minimum match value specifies that at least 2 of the 3 indexed terms are present on one product.

Query-time expansion algorithm Products that contain the terms cup, teacup, or mug are returned.

The query-time expansion algorithm adds the search term associations next to the original search terms then passes this transformed query to Solr. The minimum match value is applied to the expanded query. No minimum match value is applied if only one word is entered.

The query-time expansion algorithm works with both single-word and multiple-word search term associations. The MinMatchOption controls how many results are returned and whether some results are boosted.

Minimum match option values

The following minimum match option values can be set, where the value of the minimum match option affects how many search results are displayed to shoppers. For example, a value of 1 returns the fewest search results, while a value of 3 returns the most search results with exact matches displayed first.
0
Maintain compatibility with previous releases. Set to 0 to use the behavior in previous releases, regardless of the value of minimum match.
1
Always apply minimum match. Minimum match is used even when the shopper's query is modified to include single or multiple word search term associations, or both.

If you use this option, it is recommended that you specify minimum match as a formula. For example, mm = 2<80% 6<50%. When you use a formula, the number of matching terms adjusts dynamically to compensate for the varying length of shopper's queries. The query includes all of the shopper's search terms and the corresponding search term associations.

2
Return search results that satisfy the minimum match condition on the shopper's search terms, and any predefined search term associations for single words within the search terms.
The behavior depends on the shopper's query:
Multiple-word search term association: Also-search for and synonyms
Apply minimum match to the shopper's search terms, and any predefined search term associations for single words within the search terms. Return these products first. Then, return all products that match any predefined search term associations for multiple word search terms within the shopper's search terms, but do not apply minimum match to these results.

That is, the search results page displays products that match the minimum match parameter; then, it displays products that do not match the minimum match criteria.

Multiple-word search term association: Instead-search-for
The query includes all of the shopper's search terms and the corresponding search term associations.. Minimum match is not used.
No multiple-word search term associations
Minimum match is used. That is, the query will be the same as using option 1.
3
Expand the result set to include all products that satisfy the shopper's search terms. Products that meet the minimum match condition are displayed first, followed by other results. This option promotes products that meet the minimum match condition without limiting the search result set. Specify minimum match as either an integer or as a formula.
4
If no synonyms or replacement terms are found in the shopper's query, use the same query as option 1 (Always apply minimum match). Otherwise, return search results that satisfy the minimum match condition (if set) on the shopper's search terms first, followed by products that satisfy the minimum match condition (if set) on shopper's search terms and corresponding search term associations.

The query-time expansion algorithm does not use the synonyms.txt file; therefore, you do not need to synchronize and deploy of this file across different servers. In addition, the query-time expansion algorithm results in a smaller index because multiple-word search term associations do not need to be re-indexed. Additionally, you do not need to re-index every time after search term association changes in the Management Center. Another benefit of this feature is that different extended site stores can use different search term association lists.