Versions Compared

Key

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

Overview

Instructions to use the search endpoint to retrieve results and top trends Javascript Search Library.

Step-by-step guide

First of all, you need your URL_EMPATHYBROKER (i.e. The most popular searches)

Step-by-step guide

You can search using the search function.

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

...

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

...

 ebdemo.empathybroker.com/sb-demo-guide) from our Account Manager, Appointed Lead Developer or alternatively contact our Support team.


The library must be included inside your code before using the API. This piece of code should be inserted at the bottom of the page:

STAGING environment resources import

Code Block
languagexml
<script src="https://URL_EMPATHYBROKER/js/api/empathyutils.js" type="text/javascript"></script>
<script src="https://URL_EMPATHYBROKER/js/api/empathysearch.js" type="text/javascript"></script>



LIVE environment resources import

Code Block
languagexml
<script src="https://static.empathybroker.com/{EB_INSTANCE_NAME}/js/api/empathyutils.js" type="text/javascript"></script>
<script src="https://static.empathybroker.com/{EB_INSTANCE_NAME}/js/api/empathysearch.js" type="text/javascript"></script>

Note: Do not use your URL_EMPATHYBROKER in your LIVE environment.

Note: i.e. EB_INSTANCE_NAME = sb-demo-guide

Usage

Once the library is added to the page, you need to initialize the service:

Code Block
languagejs
var optionsempathyTAG = {
    lang:'en'
}
    
empathySearch.search('term',1,10, options, function(data){
    //the data object will contain search results and top trends
    alert('test');
});new EmpathyBrokerSearch(URL_EMPATHYBROKER).init();


At this point, you are ready to use the library:

Content by Label
showLabelsfalse
showSpacefalse
cqllabel = "empathy-search-api-javascript" and parent = "78384682"

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