Sync Search Parameter

Next step you must decide which field will be use as search field. This endpoint will help you to do that. Example: you have data with 'title'='school bag', and 'brand'='try'. If the user search 'try' and you just have 'title' as search field, that item will not show as search results. But if you also have 'brand' as search field, that item will be show as search results. So, this step is also important. So to add or remove search field, you can use this endpoint. We have attribute 'weight' to identify the priority, the highest weight will become the top priority.

note

The rules are like sync mapping, the concept is sync.

POST#

https://api.altoshift.com/api/mapping/search/sync

Header#

FieldTypeDescription
x-tokenStringtoken Users unique token

Request Header Example#

{
"x-token": "2b46ad0b537229cf450777dcc655a8620571e18556c473f065f44739"
}

Request Body#

FieldTypeDescription
fieldsObject[]Search fields object
    nameStringName of fields
    weightNumberWeight of fields (Float/Integer)

Request Body Example#

{
"fields": [
{
"name": "description",
"weight": 2
},
{
"name": "title",
"weight": 5
},
{
"name": "brand",
"weight": 4
}
]
}

Success 200#

FieldTypeDescription
successBooleanRequest was successful
updatedObject[]Updated field
    nameStringUpdated field name
    weightNumberUpdated field weight
notUpdatedObject[]Not updated field
    nameStringNot Updated field name
    weightNumberNot Updated field weight

Success Response Example#

{
"success": true,
"updated": [
{
"name": "description",
"weight": 2
},
{
"name": "title",
"weight": 5
},
{
"name": "brand",
"weight": 4
}
],
"notUpdated": []
}