$customHeader
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »

Method description

Returns the top product attributes and the top specific products for a specific query. Both the attributes and specific products weights are calculated based on user clicks, add-to-carts and purchases and the values are normalized using a linear function.

"topAttributes" objects don't have a fixed order and it may change in between requests. Although, values for each attribute are sorted by "weight" in descending order.

"topProducts" are sorted by "weight" in descending order.

HTTP method

GET

URL schema

/v2/querycontext/all/{client_id}?query={query}&lang={lang}&attributes.rows={attributes.rows}&products.rows={products.rows}

Path Parameters

Parameter nameRequiredDescription
client_id(tick)Client identifier on the system

URI Parameters

Parameter nameRequiredDescriptionDefault
query

(tick)

Search term that user did
lang(tick)Language of the query
attributes.rows (error) Number of values of each field1
products.rows (error) Number of products to return5

Responses

200 - successful request

Type: application/json

Example application/json
{
  "topAttributes": [
    {
      "field": "brand",
      "values": [
        {"value": "apple", "weight": 3},
        {"value": "sony", "weight": 1.8}
      ]
    },
    {
      "field": "category",
      "values": [
        {"value": "mobiles", "weight": 3}
      ]
    }
  ],
  "topProducts": [
    {"value":"213115", weight:"3"},
    {"value":"213149", weight:"1.3"}
  ]
}
400 - mandatory query parameter is missing

Type: application/json

Example application/json
{
  "code": 400,
  "error": "XXX is mandatory"
}
404 - either client or endpoint don't exist

Type: application/json

Example application/json
{
  "code": 404,
  "error": "XXX not found"
}

  • No labels