An intervention dictionary entry defines a single rule in an intervention dictionary. Each entry has a set of common fields shared across all dictionary types, plus type-specific fields that control the behavior of that dictionary type.
Example
{
"cmd": "add",
"word": "Yang Guo",
"created": 1536661485,
"updated": 1537320187,
"status": "ACTIVE",
"relevance": {
"100": "0",
"200": "2"
}
}Common fields
All intervention entries share the following fields regardless of dictionary type.
| Field | Type | Description |
|---|---|---|
cmd | String | The action to perform. Valid values: add, delete. |
word | String | The intervention entry text. |
status | String | The status of the entry. Valid value: ACTIVE — the entry is in effect. |
created | Integer | The timestamp when the entry was created. |
updated | Integer | The timestamp when the entry was last updated. |
Type-specific fields
Each dictionary type extends the common fields with its own fields.
Stop word filtering
Stop word filtering entries control whether a term is indexed or suppressed. Set stopword to true to add a term as a stop word and exclude it from indexing, or false to block a previously suppressed term.
Example:
{
"cmd": "add",
"word": "the",
"created": 1536661485,
"updated": 1537320187,
"status": "ACTIVE",
"stopword": true
}| Field | Type | Description |
|---|---|---|
stopword | Boolean | The intervention action. true: add the term as a stop word (exclude from indexing). false: block the term. |
Synonym configuration
Synonym configuration entries define which terms are treated as equivalents during search. Use alias to specify synonyms to add and antiAlias to specify synonyms to suppress.
Example:
{
"cmd": "add",
"word": "laptop",
"created": 1536661485,
"updated": 1537320187,
"status": "ACTIVE",
"alias": ["notebook", "portable computer"],
"antiAlias": ["desktop"]
}| Field | Type | Description |
|---|---|---|
alias | Array | Synonyms to add for the entry word. |
antiAlias | Array | Synonyms to suppress for the entry word. |
Spelling correction
Spelling correction entries map a misspelled query to its corrected form. Set enabled to true to activate the correction, or false to suppress it.
Example:
{
"cmd": "add",
"word": "seperate",
"created": 1536661485,
"updated": 1537320187,
"status": "ACTIVE",
"correction": "separate",
"enabled": true
}| Field | Type | Description |
|---|---|---|
correction | String | The corrected query that replaces the entry word when a user searches for word. |
enabled | Boolean | Whether the correction is active. true: apply the correction. false: suppress the correction. |
Category prediction
Category prediction entries associate a search term with one or more product categories and set how strongly each category is predicted. The relevance field uses the category ID as the key and a relevance score as the value.
Example:
{
"cmd": "add",
"word": "Yang Guo",
"created": 1536661485,
"updated": 1537320187,
"status": "ACTIVE",
"relevance": {
"100": "0",
"200": "2"
}
}| Field | Type | Description |
|---|---|---|
relevance | Object | Key-value pairs mapping category IDs to relevance scores. Key: the category ID. Value: 0 (irrelevant), 1 (slightly relevant), 2 (relevant). Example: {"2": 1, "100": 0}. |
Term weight analysis
Term weight analysis entries define how individual tokens within a query are weighted during search scoring. Assign a higher weight to tokens that are more semantically significant for your use case.
Example:
{
"cmd": "add",
"word": "Tan Haoqiang C language program design",
"created": 1536661485,
"updated": 1537320187,
"status": "ACTIVE",
"tokens": [
{
"token": "Tan Haoqiang",
"weight": 7
},
{
"token": "C language",
"weight": 7
},
{
"token": "program",
"weight": 1
},
{
"token": "design",
"weight": 1
}
]
}| Field | Type | Description |
|---|---|---|
tokens[] | Object | The tokens and their weights for the entry. |
tokens[].token | String | The token text. |
tokens[].weight | Integer | The weight of the token. 7: high weight. 4: medium weight. 1: low weight. |
Named entity recognition (NER)
Named entity recognition (NER) entries label the tokens of a query with entity types such as brand, category, or color. The matchType field controls when the intervention is applied: whether the full query must match exactly, or only specific tokens need to match.
Example:
{
"cmd": "add",
"word": "Doubendou soy milk",
"created": 1593429234,
"updated": 1593429242,
"status": "ACTIVE",
"tokens": [
{
"tag": "category",
"tagLabel": "Category",
"token": "Dou",
"order": 1
},
{
"tag": "category",
"tagLabel": "Category",
"token": "ben",
"order": 2
},
{
"tag": "common",
"tagLabel": "Regular word",
"token": "soy",
"order": 3
},
{
"tag": "category",
"tagLabel": "Category",
"token": "milk",
"order": 4
}
],
"matchType": 0
}| Field | Type | Description |
|---|---|---|
tokens[] | Object | The labeled tokens for the entry. |
tokens[].tag | String | The internal name of the entity type. Valid values: brand, category, material, element, style, color, function, scenario, people, season, model, region, name, adjective, category-modifier, size, quality, suit, new-release, series, marketing, entertainment, organization, movie, game, number, unit, common, new-word, proper-noun, symbol, prefix, suffix, gift, negative, agent. |
tokens[].tagLabel | String | The description of the internal name of the identified entity type. Read-only — do not specify in requests. |
tokens[].token | String | The entity text. |
tokens[].order | Integer | The sequence number. |
matchType | Integer | When to apply the NER intervention. Default value: 0. 0: apply when the search query exactly matches the entry word. 1: apply when specific tokens in the search query match the entry word. |
Drop-down suggestion whitelists
Drop-down suggestion whitelist entries promote specific terms to appear in the drop-down suggestion list. The score and matchType fields are returned in API responses but cannot be set in requests.
Example:
{
"cmd": "add",
"word": "wireless headphones",
"created": 1536661485,
"updated": 1537320187,
"status": "ACTIVE",
"score": 0.95,
"matchType": 0
}| Field | Type | Description |
|---|---|---|
score | Float | The score. Read-only — returned in responses only; cannot be set in requests. |
matchType | Integer | The matching type. Read-only — returned in responses only; cannot be set in requests. Valid values: 0, 1, 2. |
Drop-down suggestion blacklists
Drop-down suggestion blacklist entries suppress specific terms from appearing in the drop-down suggestion list. The matchType field is read-only.
Example:
{
"cmd": "add",
"word": "competitor brand",
"created": 1536661485,
"updated": 1537320187,
"status": "ACTIVE",
"matchType": 0
}| Field | Type | Description |
|---|---|---|
matchType | Integer | The matching type. Read-only — returned in responses only; cannot be set in requests. Valid values: 0, 1, 2. |
Top search whitelists
Top search whitelist entries pin specific terms to appear in the top search list. Use rank to control the position and expirationTime to set when the entry stops taking effect.
Example:
{
"cmd": "add",
"word": "summer sale",
"created": 1536661485,
"updated": 1537320187,
"status": "ACTIVE",
"rank": 1,
"expirationTime": 1893456000
}| Field | Type | Description |
|---|---|---|
rank | Integer | The position in the top search list. Valid values: 1–10. |
expirationTime | Integer | The timestamp when the intervention entry expires. Unit: seconds. |
Top search blacklists
Top search blacklist entries suppress specific terms from appearing in the top search list. The matchType field is read-only.
Example:
{
"cmd": "add",
"word": "discontinued product",
"created": 1536661485,
"updated": 1537320187,
"status": "ACTIVE",
"matchType": 0
}| Field | Type | Description |
|---|---|---|
matchType | Integer | The matching type. Read-only — returned in responses only; cannot be set in requests. Valid values: 0, 1, 2. |
Hint whitelists
Hint whitelist entries promote terms to appear in the hint list. Use expirationTime to control how long the entry remains active.
Example:
{
"cmd": "add",
"word": "new arrivals",
"created": 1536661485,
"updated": 1537320187,
"status": "ACTIVE",
"expirationTime": 1893456000
}| Field | Type | Description |
|---|---|---|
expirationTime | Integer | The timestamp when the intervention entry expires. Unit: seconds. |
Hint blacklists
Hint blacklist entries suppress specific terms from appearing in the hint list. The matchType field is read-only.
Example:
{
"cmd": "add",
"word": "out of stock",
"created": 1536661485,
"updated": 1537320187,
"status": "ACTIVE",
"matchType": 0
}| Field | Type | Description |
|---|---|---|
matchType | Integer | The matching type. Read-only — returned in responses only; cannot be set in requests. Valid values: 0, 1, 2. |