Search query rules¶
Shape the results of specific searches on a product search engine. A query rule names the searches it acts on and, for those searches only, pins products to the top, hides products, or boosts products by a field value. Rules live on the engine, so they apply to every search config using it, and they have no draft: a saved rule is live at once.
A search is compared with a rule's queries after normalisation, lower case, trimmed, single spaces, so "Running Shoes" and "running shoes" are the same query. A trailing * matches every search starting with the text before it (run*), and * alone matches every search. Each query can belong to only one rule of an engine.
Products are addressed by their URL, the same URL productData_get shows. Pinned products appear in the order you list them.
Tips & tricks¶
Pick the card that matches what you're doing. Each prompt is ready to paste into your assistant.
Put the right products first for a search
When a search returns the right products in the wrong order, pin the ones that should lead. The pin applies to that search only, and the rest of the results keep their normal ranking.
Boost a brand for one search only
An engine boost lifts a brand in every search. A rule boost lifts it only for the searches you name, so a campaign on "trainers" leaves "boots" alone. Read the current rules first: a query can sit in one rule only.
search_listQueryRules¶
List the query rules of a product search engine. Each rule shows its queries, the products pinned to the top (elevates, in display order), the products hidden (excludes) and its boosts. A pinned or hidden product that has since left the catalog keeps its productId with url and title empty, so you can still see and remove it.
| Name | Type | Required | Description |
|---|---|---|---|
websiteUuid | string | Yes | The UUID of the customer's website in Hello Retail. Use website_getInfo to look up available websites, or find it in my.helloretail.com under Settings → Website Settings → Website Unique Id. |
engineId | integer | Yes | The id of the product search engine, from search_listProductEngines. |
Example request & response
search_getQueryRule¶
Get one query rule of a product search engine: its queries, pinned products in order, hidden products and boosts.
| Name | Type | Required | Description |
|---|---|---|---|
websiteUuid | string | Yes | The UUID of the customer's website in Hello Retail. Use website_getInfo to look up available websites, or find it in my.helloretail.com under Settings → Website Settings → Website Unique Id. |
engineId | integer | Yes | The id of the product search engine, from search_listProductEngines. |
ruleId | integer | Yes | The id of the rule, from search_listQueryRules. |
Example request & response
One rule, in the shape search_listQueryRules returns for each entry.
search_addQueryRule¶
Add a query rule to a product search engine. The rule acts on every search matching one of its queries. A query can belong to only one rule of the engine; the tool refuses a query another rule already has and names it.
Write operation applied to live search
Rules have no draft. The new rule applies immediately to every search config using the engine. Your assistant will ask for confirmation before this runs.
| Name | Type | Required | Description |
|---|---|---|---|
websiteUuid | string | Yes | The UUID of the customer's website in Hello Retail. Use website_getInfo to look up available websites, or find it in my.helloretail.com under Settings → Website Settings → Website Unique Id. |
engineId | integer | Yes | The id of the product search engine, from search_listProductEngines. |
queries | string[] | Yes | The searches the rule acts on, at least one. Matched after normalisation; a trailing * matches every search starting with the text before it, * alone matches every search. |
elevates | string[] | No | URLs of the products to pin to the top, in the order they should appear. |
excludes | string[] | No | URLs of the products to hide from the results. A product cannot be both pinned and hidden. |
boosts | array | No | Boosts for these searches only. Fields per entry are described below. |
Each boost has these fields, the same as an engine boost:
| Name | Type | Required | Description |
|---|---|---|---|
field | string | Yes | A field from search_getProductEngineBoosts's availableFields. |
value | string | Yes | The exact indexed value the field must have. Hierarchy values use the raw $-separated encoding (kids$shoes for Kids > Shoes); productData_getFieldValues lists the real values. |
boost | integer | Yes | From -10 to 10, the same scale as the dashboard. Positive amounts lift the matching products and negative amounts bury them. |
Example request & response
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search_addQueryRule",
"arguments": {
"websiteUuid": "<string>",
"engineId": 0,
"queries": ["running shoes", "runners"],
"elevates": ["https://shop.example/p/123", "https://shop.example/p/456"],
"excludes": ["https://shop.example/p/789"],
"boosts": [
{
"field": "brand",
"value": "Nike",
"boost": 2
}
]
}
}
}
The created rule, in the shape search_listQueryRules returns for each entry.
search_updateQueryRule¶
Update a query rule of a product search engine. Every list is optional, and a list you provide replaces that part of the rule in full: omitted lists are left unchanged, an empty list clears that part. Read the rule with search_getQueryRule first when you are adding or removing a single entry.
Write operation applied to live search
Rules have no draft. The change applies immediately to every search config using the engine. Your assistant will ask for confirmation before this runs.
| Name | Type | Required | Description |
|---|---|---|---|
websiteUuid | string | Yes | The UUID of the customer's website in Hello Retail. Use website_getInfo to look up available websites, or find it in my.helloretail.com under Settings → Website Settings → Website Unique Id. |
engineId | integer | Yes | The id of the product search engine, from search_listProductEngines. |
ruleId | integer | Yes | The id of the rule to update, from search_listQueryRules. |
queries | string[] | No | The complete new list of searches, at least one. |
elevates | string[] | No | The complete new list of pinned product URLs, in display order. |
excludes | string[] | No | The complete new list of hidden product URLs. |
boosts | array | No | The complete new list of boosts, with the fields described under search_addQueryRule. |
Example request & response
The updated rule, in the shape search_listQueryRules returns for each entry.
search_deleteQueryRule¶
Delete a query rule of a product search engine. The searches it covered fall back to the engine's normal results at once. Read it with search_getQueryRule first if you may want to recreate it.
Write operation applied to live search
Rules have no draft and there is no undo. Your assistant will ask for confirmation before this runs.
| Name | Type | Required | Description |
|---|---|---|---|
websiteUuid | string | Yes | The UUID of the customer's website in Hello Retail. Use website_getInfo to look up available websites, or find it in my.helloretail.com under Settings → Website Settings → Website Unique Id. |
engineId | integer | Yes | The id of the product search engine, from search_listProductEngines. |
ruleId | integer | Yes | The id of the rule to delete, from search_listQueryRules. |