Examples: Search term association expansion

Several factors determine how a shopper's search query is expanded into a Solr query. The expanded query depends on: the search term association type (synonyms, also-search-for, and instead-search-for); the value of the minimum match parameter; the value of the minimum match option parameter, and whether any search term associations within the shopper's query contain single or multiple words.

The following examples illustrate combining minimum match with search term associations, in all cases the minimum match value is 2:

Example: Using synonyms

The following sample uses these terms as synonyms: azure, navy blue.
Product data Shopper's query MinMatchOption Search result Explanation
  • azure shirt
  • navy blue shirt
  • azure dress
  • men backpack
  • azure shirt for girls
men navy blue shirt 1
  • azure shirt
  • navy blue shirt
  • azure shirt for girls
The result order depends on which fields in the products are indexed.
Minimum match is applied to the expanded query.

For reference, the following code snippet shows the expanded Solr query: q= men navy blue ("navy blue" azure) shirt&mm=2.

2
  1. navy blue shirt
  2. azure shirt
  3. azure dress
  4. azure shirt for girls
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
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.

For reference, the following code snippet shows the expanded Solr query: q=(_query_:"{!edismax mm='2'} men navy blue shirt")^2 OR (_query_:"{!edismax } (\“navy blue\” azure)”)

3
  1. navy blue shirt
  2. azure shirt
  3. azure shirt for girls
  4. men backpack
  5. azure dress
Always use two sub-queries, where the first subquery contains the minMatch parameter, the shopper's search terms, and the expanded search term association terms for the single word search term associations in shopper's query. The second subquery contains no minMatch parameter, and the shopper's search terms and all corresponding expanded search term association terms. The first subquery is boosted by a factor.

For reference, the following code snippet shows the expanded Solr query: q=(_query_:"{!edismax mm='2'} men navy blue shirt")^2 OR (_query_:"{!edismax } men navy blue shirt (\"navy blue\" azure )")

4
  1. navy blue shirt
  2. azure shirt
  3. azure shirt for girls
Products that meet the minimum match criteria on the shopper's search terms are returned first, followed by products that satisfy the minimum match condition on the shopper's search terms and corresponding search term associations.

For reference, the following code snippet shows the expanded Solr query: q=(_query_:"{!edismax mm='2'} men navy blue shirt")^2 OR (_query_:"{!edismax mm='2' } men navy blue (\“navy blue\” azure) shirt”)

Example: Using synonyms and replacement terms (instead-search-for)

The following sample uses these terms as synonyms: boy, young men; and these terms as replacements: navy blue is replaced by azure.
Product data Shopper's query MinMatchOption Search result Explanation
  • azure shirt
  • navy blue shirt
  • boy shirt
  • azure shirt for girls
young men navy blue shirt 1
  • azure shirt
  • boy shirt
  • azure shirt for girls
Minimum match is applied to the query.

For reference, the following code snippet shows the expanded Solr query: q=young men shirt ("young men" boy )azure&mm=2

2
  • azure shirt
  • boy shirt
  • azure shirt for girls
Products that match any of the query terms are displayed next.
Minimum match is ignored.

For reference, the following code snippet shows the expanded Solr query: q=young men ("young men" boy) azure shirt

3
  • azure shirt
  • azure shirt for girls
  • boy shirt
Products that match any of the query terms are displayed next.
Products that match the transformed query are boosted.

For reference, the following code snippet shows the expanded Solr query: q=(_query_:"{!edismax mm='2'} young men shirt azure")^2 OR (_query_:"{!edismax } young men shirt (\"young men\" boy ) azure")

4
  • azure shirt
  • boy shirt
  • azure shirt for girls
Minimum match is applied to the query.

For reference, the following code snippet shows the expanded Solr query: q=young men shirt ("young men" boy )azure&mm=2