Returning Results

/*
* Simple integration. The custom client internally translates the current
* URL into a search request and makes an AJAX request to return results.
*/
window.addEventListener("load", function () {
search.requestResults();
});
/*
* Complex integration. Every custom client has a getRequestFromUrl()
* function that is specific to the customer website and translates their URL
* structure into a search request object.
*/
window.addEventListener("load", function () {
var request = search.getRequestFromUrl(window.location.href);
if (request.term) {
search.requestResults(request);
}
});

To show results on your search page, first you need to translate the page URL into a search request object. Then, if the search request contains a search term, tell the client to request results. When the results are received by the client, it will automatically populate the components configured in the UI options.