Include Search Rule Input

Include search rule input.
Root XML tag
<searchResultsRule>
JSON example
1{
2  "searchResultsRules": [
3    {
4      "type": "BidirectionalSynonym",
5      "ruleDefinition": [
6        "shirt",
7        "blouse",
8        "top"
9      ],
10      "locales": [
11        "en_US"
12      ]
13    },
14    {
15      "type": "UnidirectionalSynonym",
16      "ruleDefinition": [
17        "jeans",
18        "denim pants"
19      ],
20      "locales": [
21        "en_US"
22      ]
23    },
24    {
25      "type": "BidirectionalSynonym",
26      "ruleDefinition": [
27        "dress",
28        "gown"
29      ],
30      "locales": [
31        "en_GB"
32      ]
33    }
34  ]
35}
Properties
Name Type Description Required or Optional Available Version
locales String Comma-separated list of locales that the include search rule applies to. Required 58.0
ruleDefinition String Comma-separated list of terms that the include search rule applies to. Valid number of unique strings is from 2 through 5. Required 58.0
type String Type of search rule. Value is:
  • BidirectionalSynonym—Use when terms are interchangeable and must return the same results both ways. For example, jacket ⇄ winter coat. Available from API version 66.0 and later.
  • Include—Use when a term in a query matches any term in a ruleDefinition, Commerce Search returns results for all terms in the list. Supported in API versions 58.0 to 66.0.

    We suggest using BidirectionalSynonym, which returns equivalent results for interchangeable terms in both directions, unlike Include.

    Note

  • UnidirectionalSynonym—Use when one term must expand results, but not necessarily the reverse. For example, jacket → hoodie. Available from API version 66.0 and later.
Required 58.0