Javascript Search Library: nextQueries

Overview

Instructions to use the service to retrieve next queries that were made by other users when searching the initial one.

Step-by-step guide

You can search using the nextQueries function.

nextQueries (term, options, callback)


Parameters

ParameterDescriptionData TypeMandatory
termsThe query typed by the userStringYes
options

Object that may contain information about filters and other required data for example: scope

ObjectNo
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

var options = {
    lang:'en',
	scope:'desktop'
}
    
empathySearch.nextQueries('shirt', options, function(data){
    //the data object will contain top clicked
    alert('test');
});

Example of response

[
	{
		"query": "jeans"
	},
	{
		"query": "blouse"
	}
]