The purpose of this guide is to provide the steps required to integrate search service via REST API and use the returned tagging urls for each event (query, click, add2cart, ...).
|Parameter Name||Scope||Description||Type||Mandatory||Default Value|
|q||search||The query for the request||String|
|lang||search & tagging||Set the language used on this request||String|
|session||search & tagging||Set the session used on this request||String|
|user||search & tagging||Set the user used on this request||String|
|scope||search & tagging||Set the scope used on this request||String|
|origin||tagging||Set the origin of the request (default, GA, partials, ...)||String|
|start||search||The number of results to omit from the start of the result set (search pagination)||Integer||0|
|rows||search||Number of results to return (search pagination)||Integer||10|
|filter||search||Set query filters to apply||String|
|facet||search||Set query facets to return||String|
|jsonCallback||search||Name of the callback that will be executed after the request||String|
|suggestions.suggestion.docs||search||Number of results to include for each suggestion||String|
First of all, you need to send a request with the fields that you want to use for this purpose (ie: price). Then you'll be able to use the sort param to sort the results.
The request param used for this purpose is sort and the format of the value is: field order
Note: this param can be send only one time.
Below, you can find some samples for sorting:
First of all, you need to send a request with the fields that you want to use for this purpose (ie: category). Then you'll be able to use the facet param to request facets.
Note: to add more facets to the query, you should simply repeat the facet parameter.
Below, you can find a sample to request a facet over brand_facet field:
NOTE: The following code is just an example, don't copy & paste this for your use
There are different output formats depending of the search results.
Results + topTrends (empathize) (including categories for the most popular query)
By default, the service will return two JSON nodes, one for the search results (content) and another one for the topTrends (more popular queries and categories for the first one).
Moreover this JSON includes one node per product with the tagging urls and one additional node with the search tagging url.
According to the 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.
- topTrends → Popular trends, including category facet for the first one.
- ebTagging.query → URL to send the query associated tagging event to our tagging service.
According to the previous example:
- ebTagging.* → URLs to send the product associated tagging events to our tagging service.
Spellcheck + topTrends (empathize)
The search engine can detect grammatical errors and automatically correct it, for example searching by "sammsung" the system will suggest "samsung" in the spellchecked node.
Suggestions + topTrends (empathize)
For example searching by "samsung panasonic" the search engine detects than there're no products with both terms but there are products with each term separately.
The suggestions node will contain one or more suggestions for each term or combination of terms contained in the query typed by the user.
- suggestion → term suggested by the search engine
- numFound → number of results that the search engine will return searching using this suggestion
- docs → By default, the search engine will return a sample of the results using this suggestion