const customSearchClient = {
search(requests, cb) {
return fetch('https://algolia-backend-search.herokuapp.com/search', {
method: 'post',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ requests }),
}).then(function(res){return res.json()}).then(cb)
}
};
var alSH = angular.module('AlgoliaSearchHelper', ['ngSanitize']);
// Expose the helper
alSH.factory('helper', function() {
return algoliasearchHelper(customSearchClient, index, {
disjunctiveFacets: ['category'],
hitsPerPage: 7,
maxValuesPerFacet: 3
});
});