Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Instructions to use the search endpoint to retrieve just top trends clicked (i.e. The most popular searchesclicked products)

Step-by-step guide

You can search using the empathize topclicked function.

Code Block
languagejs
empathizetopclicked (term, start, rows, options, callback)


Parameters

ParameterDescriptionData TypeMandatory
termsThe query typed by the userStringYes
startThis parameter is used to paginate results from a queryIntegerNo
rowsThis parameter is used to paginate results from a queryIntegerNo
optionsObject that may contain information about filters and other required data for example: scopeObjectNo
callbackFunction that will be executed after sending dataFunctionNo

Notes:

  • Additional parameters should be included into the options object. The list of parameters that can be included into the options parameter can be checked visiting the Search section of SEARCH REST API
  • To view the format of the JSON result, visit also the Search section of SEARCH REST API


Code samples

Code Block
languagejs
var options = {
    lang:'en',
	scope:'desktop'
}
    
empathySearch.empathizetopclicked('term', 1, 10, options, function(data){
    //the data object will contain top trendsclicked
    alert('test');
});

Filter by label (Content by label)
cqllabel = "empathy-search-api-javascript" and space = currentSpace()