A customized search rule is represented as a customized_search object. A customized_search object is a JSON object where each key, value pair corresponds to a rule and what property should be pinned and what property should be hidden.
All pins and hides must be either string
or int
Attribute | Type | Required | Content |
---|---|---|---|
query | str | Required | The query for which the custimized search rules should be applied |
products | 'dict' with keys pin and hide which has value list | Required | The products which should be pinned to the top of the query and the products which should be hidden. |
categories | 'dict' with keys pin and hide which has value list | Required | The categories which should be pinned to the top of the query and the categories which should be hidden. |
suggestions | 'dict' with keys pin and hide which has value list | Required | The suggestions which should be pinned to the top of the query and the suggestions which should be hidden. |
pages | 'dict' with keys pin and hide which has value list | Required | The pages which should be pinned to the top of the query and the pages which should be hidden. |
{
"query": "pants",
"products": {
"pin" : [123,456],
"hide" : [555,222]
},
"categories": {
"pin" : [12,67],
"hide" : [555]
},
"suggestions": {
"pin" : ["trousers","skitrousers"],
"hide" : ["trouts"]
},
"pages": {
"pin" : [999,111],
"hide" : [543,234,788]
}
}