Skip to content

Instantly share code, notes, and snippets.

@erikpantzar
Created November 3, 2015 15:23
Show Gist options
  • Select an option

  • Save erikpantzar/c7f065b9f9ab18f3353a to your computer and use it in GitHub Desktop.

Select an option

Save erikpantzar/c7f065b9f9ab18f3353a to your computer and use it in GitHub Desktop.
var queryObj = {
query: "organic",
categories: ['refreshments']
brands: []
};
var searchObject = {
"QueryString": queryObj.query,
"DirectResults_FromIndex": 0,
"DirectResults_ToIndex": 19,
"RecomendedResults_FromIndex": 0,
"RecomendedResults_ToIndex": 19,
"UserId": "sNa8ziAYS5",
"Faceting": {
"Categories": queryObj.categories,
"Brands": queryObj.brands
},
"IP": "000.000.000.00"
};
$http.post(api.loop54.search, searchObject, {withCredentials: false})
.then(function(response) {
search.result = response.data;
callback(response);
console.group('Query w Facets');
console.log(queryObj);
console.log(search.result);
console.groupEnd();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment