GET Items
Search items by given user search query.
GET#
Permission: all
#
Example Usage#
ParameterField | Type | Description |
---|---|---|
query | String | Search query given by user |
token | String | Engine's token |
categoryIds optional | String[] | Filter products by category ids |
internalCallAuthorized optional | String | Token from requests from client panel |
timeZone optional | String | user's time zone (for stats) |
sessionId optional | String | user's session id (for stats) |
type optional | String | available value - popular, in this case only popular products will be returned and 'query' param will be ignored. Allowed values: "popular" |
skip optional | Integer | Number of items to skip (for pagination) |
limit optional | Integer | Number of max in response (for pagination) |
method optional | String | Search method. Allowed values: "strict" , "soft" , "fuzzy" , "all" |
method_start optional | String | Search method, start from. Allowed values: "strict" , "soft" , "fuzzy" |
filter optional | String[] | filter in url-encoded JSON, ex. filter={"term":{"brand":["LENOVO","TUCANO"]}}&filter={"range":{"price":{"gte":8452399}}}&filter={"range":{"price":{"lte":17022070}}} |
sort optional | String[] | sort in url-encoded JSON, ex. sort={"price": {"order": "asc"}} |
agg_term_limit optional | Integer | Set custom aggregation limit, set limit of filters |
min_score optional | Float | min_score exclude results where score < min_score |
collapse optional | String | Group the products base on specific fields. The use case is for a client that want to show the search result is group by merchant when the search engine is base on product. Ex: collapse={"field":"profileId","inner_hits":{"name":"services","size":100}} |
preference optional | String | Parameter to make sure the same user served by same shard (effective for collapse). Usually the value is sessionId |
geo optional | Object | Parameter to use geolocation feature |
geo.filter optional | Boolean | Filter the result by provided distance, Ex: true, false |
geo.distance optional | String | Distance to filter, Ex: "1km" |
geo.location optional | Object | Location of the request, Ex: {"geo": { "location": { "lat": "40.12", "lon": "-71.34" } |
geo.order optional | String | Sort by distance, Ex: "asc", "desc" |
#
Success ResponseField | Type | Description |
---|---|---|
method | String | query which returned the result (possible values: strict, fuzzy) |
categoryProductsCount | Object | Key value map, key - category id, value - number of products found by this search query in this category |
searchId | String | Generated id of the search |
products | Object[] | array of products found by user's query |
itemId | String | Elastic product id |
image_link | String | URL of product image |
price | String | Product current price |
availability | String | Indicates if product is in stock or it is not |
title | String | Product Name |
link | String | Product link on website |
productId | String | Product's id |
categoryIds | String[] | Array of product category ids |
promoted | Object[] | array of promoted products, same structure as for products |
total | Integer | Total number of products found by the user's query |
totalCollapse | Integer | Total number of products found by the user's collapse query |