Search REST API: Browse
Overview
Instructions to use REST API Browse service.
Step-by-step guide
Service Name
browse
Service URL
URL_SEARCH/INSTANCE_ID/browse?INPUT_PARAMETERS
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 |
Sorting
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.
title A-Z
sort=name_sort asc
title Z-A
sort=name_sort desc
price min to max
sort=price asc
price max to min
sort=price desc
Boosting
Boosting allows you to modify the default ranking pushing to the top the documents matching the specified queries.
Boosting Nike and Rebook products
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
Faceting
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.
Output
There are different outputs depending of the search results.
Results
By default, the service will return one node for the search results (content),
{ content: {} }
{ 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:
- numFound → number of the documents returned by the service
- docs → Json array with the documents returned by the service. Each one will contain all the fields configured to be returned by the search service.
- facets → filters, will contain one entry for each facet contained in the request using the facets param or directly configured in the search service by the EB Team.
Related articles
-
Search REST API: Search & Tagging (Empathy Knowledge Base)
-
Search REST API: TopClicked (Empathy Knowledge Base)
-
Search REST API: Links (Empathy Knowledge Base)
-
Search REST API: Search (Empathy Knowledge Base)
-
Empathy Search REST API (Empathy Knowledge Base)
-
Search REST API: Search Trends (Empathy Knowledge Base)
-
Search REST API: Browse (Empathy Knowledge Base)
-
Search REST API: Browse & Tagging (Empathy Knowledge Base)
-
Search REST API: FullSearch & Tagging (Empathy Knowledge Base)
-
Search REST API: Empathize (Empathy Knowledge Base)