Using our boost and bury functionality, you can apply your business logic and have specific brands and/or products rank higher or lower in search results and category listings.
{
"Id": "11",
"Title": "Organic Chicken breast",
"Category": "Meat",
"SubCategory": "Bird",
"Manufacturer": "Happy birds",
"Contents": "Meat from chicken",
"Description": "Chicken is the most common type of poultry in the world. In developed countries, chickens are usually subject to intensive farming methods.",
"Organic": true,
"ImageUrl": "http://www.loop54.com/hubfs/demo_images/organicchickenbreast.jpg",
"OrgPrice": 65,
"Price": 55,
"Campaigns":["Sale", "Organic sale"]
}
This product has a boolean, "IsNew". We can use that as well.
{
"Id": "14",
"Title": "Powdered sugar",
"Category": "Pantry",
"SubCategory": "Sugar",
"Manufacturer": "Sweet Home Alabama",
"Contents": "Ground sugar from sugar cane",
"Description": "Sugar is the generalized name for sweet, short-chain, soluble carbohydrates, many of which are used in food. They are carbohydrates, composed of carbon, hydrogen, and oxygen. There are various types of sugar derived from different sources. Simple sugars are called monosaccharides and include glucose (also known as dextrose), fructose and galactose. The table or granulated sugar most customarily used as food is sucrose, a disaccharide. (In the body, sucrose hydrolyses into fructose and glucose.) Other disaccharides include maltose and lactose. Longer chains of sugars are called oligosaccharides. Chemically-different substances may also have a sweet taste, but are not classified as sugars. Some are used as lower-calorie food substitutes for sugar described as artificial sweeteners.",
"Organic": false,
"ImageUrl": "http://www.loop54.com/hubfs/demo_images/powderedsugar.jpg",
"OrgPrice": 11,
"Price": 11,
"IsNew": true
}
POST to http://helloworld.54proxy.com/productsincategory
{
"UserId" : "helloworlduser",
"IP" : "127.0.0.1",
"RequestEntity":{
"EntityType":"Category",
"ExternalId":"Fruit"
},
"ProductsInCategory_FromIndex" : 0,
"ProductsInCategory_ToIndex" : 9,
}
Response: 200 OK
{
"Success": true,
"HeroId": "The Count with not enough Writing Sisters",
"Data": {
"ProductsInCategory": [
{
"Key": {
"ExternalId": "1",
"EntityType": "Product",
"Attributes": {
"Manufacturer": [
"The banana company"
],
"Category": [
"Fruit"
],
"Title": [
"Banana"
],
"SubCategory": [
"Musaceae"
]
}
},
"Value": 1
},
{
"Key": {
"ExternalId": "7",
"EntityType": "Product",
"Attributes": {
"Manufacturer": [
"The banana company"
],
"Category": [
"Fruit"
],
"Title": [
"Organic Apple"
],
"SubCategory": [
"Rosaceae"
]
}
},
"Value": 0
},
{
"Key": {
"ExternalId": "3",
"EntityType": "Product",
"Attributes": {
"Manufacturer": [
"Fruits n Veggies"
],
"Category": [
"Fruit"
],
"Title": [
"Apple"
],
"SubCategory": [
"Rosaceae"
]
}
},
"Value": 0
},
{
"Key": {
"ExternalId": "17",
"EntityType": "Product",
"Attributes": {
"Manufacturer": [
"Fruits n Veggies"
],
"Category": [
"Fruit"
],
"Title": [
"Orange"
],
"SubCategory": [
"Citrus"
]
}
},
"Value": 0
}
]
}
}
Request loopRequest = new Request("ProductsInCategory",request,response);
loopRequest.setValue("RequestEntity", new Entity("Category",request.getParameterValues("category")[0]));
loopRequest.setValue("ProductsInCategory_FromIndex", 0);
loopRequest.setValue("ProductsInCategory_ToIndex", 9);
Response loopResponse = RequestHandling.getResponse("http://helloworld.54proxy.com", loopRequest);
if (loopResponse.success)
{
if(loopResponse.hasData("ProductsInCategory"))
{
ArrayList results = loopResponse.getItemArray("ProductsInCategory");
if(results.isEmpty())
response.getWriter().print("There were no items in this category.");
for(Item resultItem: loopResponse.getItemArray("ProductsInCategory"))
{
String productId = ((Entity)resultItem.key).externalId;
String productTitle = ((Entity)resultItem.key).getAttribute("Title").firstValue();
response.getWriter().print(productId + " " + productTitle); //render a product on the category listing page
}
}
}
else
{
response.getWriter().print("ERROR: " + loopResponse.requestId); //keep track of unsuccessful requests
}
var request = new Loop54.Request("ProductsInCategory");
request.SetValue("RequestEntity", new Loop54.Model.Entity("Category", Request.QueryString["category"]));
request.SetValue("ProductsInCategory_FromIndex", 0);
request.SetValue("ProductsInCategory_ToIndex", 9);
var response = Loop54.RequestHandling.GetResponse("http://helloworld.54proxy.com", request);
if (response.Success)
{
var results = response.GetValue<List<Item<Entity>>>("ProductsInCategory");
if (!results.Any())
Response.Write("There were no items in this category.");
foreach (var resultItem in results)
{
var productId = resultItem.Key.ExternalId;
var productTitle = resultItem.Key.Attributes["Title"].FirstOrDefault() as string;
Response.Write(productId + " " + productTitle + Environment.NewLine); //render a product on the category listing page
}
}
else
{
Response.Write("ERROR: " + response.RequestId + Environment.NewLine);
}
Remember that boost and bury rules can be added, removed or changed at any time.
Product overview
Technology