The purpose of this guide is to provide the steps required to integrate browse service via REST API and use the returned tagging urls for each event (query, click, add2cart, ...).
browse
URL_SEARCH/INSTANCE_ID/browse?INPUT_PARAMETERS
Parameter | Description | Data Type | Mandatory |
---|---|---|---|
categoryId | The category that has been clicked to filter by | String | Yes |
lang | Set the language of the query | String | Yes |
start | It is used to paginate results from a query | Integer | Yes |
rows | It is used to paginate results from a query | Integer | Yes |
filter | Set query filters | String | No |
boost | boosting query in lucene query format | String | No |
facet | Set query facets | String | No |
sort | Sort results | String | No |
jsonCallback | Name of the callback that will be executed after the request | String | No |
Send us a request with the fields you want to use for SORTING and we will configure it.
You can find below some code samples of the api syntax for sorting.
sort=name_sort asc |
sort=name_sort desc |
sort=price asc |
sort=price desc |
Boosting allows you to modify the default ranking pushing to the top the documents matching the specified queries.
boost=brand:Nike^2.1 OR brand:Rebook^1.3 |
boost parameter can be specified multiple times, so multiple queries could be specified as part of a single query using OR (as specified above) or specifying those queries in individual boost parameters.
boost=brand:Nike^2.1&brand:Rebook^1.3 |
Send us a request with the list of fields that you want to use for FACETING and we will add it to the config.
Example of the api syntax for faceting, with the field brand_facet:
facet={!ex=brand_facet}brand_facet |
To add more facets to the query, you should simply repeat the facet parameter.
There are different outputs depending of the search results.
By default, the service will return one node for the search results (content).
Moreover this JSON includes one node per product with the tagging urls and one additional node with the search tagging url.
{ content: {}, ebTagging: { browseCategory: "URL_EMPATHYBROKER/tagging/v1/track/CLIENT_ID/browseCategory?categoryId=QUERY&scope=default&lang=es&totalHits=10&page=1...." } } |
{ content: { numFound: 14, docs: [ { name: "Samsung Galaxy Note 10.1" }, { name: "Samsung SNH-1010N Smartcam" }, ], facets: [ { facet: "brand", values: [ { value: "samsung", count: 13, filter: "brand:samsung" }, { value: "SBS", count: 1, filter: "brand:SBS" } ] } ] } } |
According to the previous example:
docs: [ { name: "Samsung Galaxy Note 10.1", [... more fields ...] ebTagging: { browseProduct: "URL_EMPATHYBROKER/tagging/v1/track/CLIENT_ID/browseProduct?categoryId=QUERY&scope=default&lang=es&url=PRODUCT_URL&page=1&productId=PRODUCT_ID&title=PRODUCT_NAME&type=4", browseAdd2Cart: "URL_EMPATHYBROKER/tagging/v1/track/CLIENT_ID/browseAdd2Cart?categoryId=QUERY&scope=default&lang=es&url=PRODUCT_URL&page=1&productId=PRODUCT_ID&title=PRODUCT_NAME&type=4", browseCheckout: "URL_EMPATHYBROKER/tagging/v1/track/CLIENT_ID/browseCheckout?categoryId=QUERY&scope=default&lang=es&url=PRODUCT_URL&page=1&productId=PRODUCT_ID&title=PRODUCT_NAME&type=4" } }, { name: "Samsung SNH-1010N Smartcam", [... more fields ...] ebTagging: { browseProduct: "URL_EMPATHYBROKER/tagging/v1/track/CLIENT_ID/browseProduct?categoryId=QUERY&scope=default&lang=es&url=PRODUCT_URL&page=1&productId=PRODUCT_ID&title=PRODUCT_NAME&type=4", browseAdd2Cart: "URL_EMPATHYBROKER/tagging/v1/track/CLIENT_ID/browseAdd2Cart?categoryId=QUERY&scope=default&lang=es&url=PRODUCT_URL&page=1&productId=PRODUCT_ID&title=PRODUCT_NAME&type=4", browseCheckout: "URL_EMPATHYBROKER/tagging/v1/track/CLIENT_ID/browseCheckout?categoryId=QUERY&scope=default&lang=es&url=PRODUCT_URL&page=1&productId=PRODUCT_ID&title=PRODUCT_NAME&type=4" } }, ] |
According to the previous example: