No results: Use Hawksearch Spotlights and campaign
If the customer types in a search word that does not yield any results, you have an opportunity to communicate with them by adding relevant text messages, targeted ads, banners, and widgets using Hawksearch dashboard.
Example use case: Display Popular Products for no results search page.
Step 1: Set up a Spotlight item like below by adding items that you want to display on the no results page.
Steps to add a Spotlight Item: Product Spotlighting | ProductSpotlighting AddProductSpotlight
Step 2: Set up a campaign that would define the trigger when the Spotlight created above should be returned in the response.
Steps to add a Campaign: Campaigns | Campaigns AddingaNewCampaign
Step 3: Please confirm that the Popular searches Content item is being returned in the response for no results page.
Request: POST request to search keyword “abcdefg”:
POST /api/v2/search HTTP/1.1
Host: searchapi-dev.hawksearch.net
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: b1dc5ba6-9262-bc68-c48a-0a344afe5316
{
"index":"elasticdemo.20210325.082034",
"ClientGuid": "f12458r1c38446f0bacdf283390c37e8",
"keyword":"abcdefg"
}
Response: In the search results response structure, there are 2 main keys which include the information about the Spotlight/Campaign created above:
“Items” is the array of items to be displayed on the page
“Trigger” indicates the Campaign information and the rule being used to insert the content item in the response.
"Merchandising": {
"Items": [
{
"Zone": "Top",
"Title": "Some items you may like",
"Name": "No results",
"ContentType": "featured",
"ForwardUrl": "",
"Output": "",
"WidgetArgs": "",
"IsMobile": false,
"IsTrackingEnabled": true,
"Items": [
{
"DocId": "Item_74225",
"Score": 93,
"Document": {
"brand": [
"Columbia Sportswear"
],
"image": [
"https://dev.hawksearch.net/assets/1/14/DimThumbnail/Silver-Ridge-Plaid-LS-Shirt_Fossil-Dobby.jpg"
],
"url": [
"/details.aspx?itemid=Item_74225"
],
"itemname": [
"Men's Silver Ridge Plaid Long Sleeve"
],
"rating": [
"+0000000000000001.0000"
],
"itemtypeid": [
"3"
],
"saleprice": [
"+0000000000000047.9700"
],
"createdate": [
"2020-11-22T14:12:47"
],
"type": [
"Item"
],
"ratingrange": [
"+0000000000000001.0000"
],
"content": [
"men's silver ridge plaid long sleeve <div class="descwrpr"><div class="descsubwrpr"><h2>product description</h2><br><p>designed to keep you dry, protected and comfortable during long active days in the sun, this columbia classic features quick-wicking material, strategic venting, classic plaid prints and built-in upf 40 blocking power.&nbsp;</p></div></div> men men shirts men shirts casual shirts travel travel clothing men's travel clothing specials sportswear mens specials sportswear mens shirts summer sale men summer sale men shirts summer sale men shirts casual shirts summer sale packs backpacking packs summer sale travel travel clothing men's travel clothing summer sale men shirts hiking/travel shirts men shirts hiking/travel shirts specials sat dec 15th kids long sleeve summer sale packs summer sale travel travel clothing summer sale travel deals for dad shirts specials sportswear sale specials summer sale deals for dad summer clearance columbia sportswear medium extra large purple blue green blue "
],
"id": [
"Item_74225"
],
"price": [
"+0000000000000060.0000"
],
"department_nest": [
"1|Summer Sale",
"2|Summer Sale/Travel",
"3|Summer Sale/Travel/Travel Clothing",
"1|Specials",
"2|Specials/Sat Dec 15th",
"3|Specials/Sat Dec 15th/Kids",
"1|Men",
"2|Men/Shirts",
"3|Men/Shirts/Hiking",
"4|Men/Shirts/Hiking/Travel Shirts",
"2|Summer Sale/Men",
"3|Summer Sale/Men/Shirts",
"2|Summer Sale/Packs",
"3|Summer Sale/Packs/Backpacking Packs",
"2|Specials/Sportswear",
"3|Specials/Sportswear/Mens",
"1|Travel",
"2|Travel/Travel Clothing",
"3|Travel/Travel Clothing/Men's Travel Clothing",
"3|Men/Shirts/Casual Shirts"
],
"imagealttag": [
"Silver-Ridge-Plaid-LS-Shirt_Fossil-Dobby"
],
"sku": [
"\r\n "
],
"subdepartmentpath": [
"1|Men",
"1|Travel",
"1|Specials",
"1|Summer Sale",
"1|Long Sleeve",
"1|Deals for Dad",
"1|Sale",
"1|Summer Clearance"
]
},
"BestFragments": {
"itemname": "Men's Silver Ridge Plaid Long Sleeve"
},
"IsPin": false,
"IsVisible": true
}
],
"Target": "",
"MobileWidth": 0,
"MobileHeight": 0,
"Trigger": {
"BannerGroupId": 56297,
"Name": "No Results Test",
"SortOrder": 0,
"Rule": {
"RuleType": 0,
"Field": "",
"Condition": "",
"Value": "",
"FieldType": "System.String",
"Guid": "d9581b8790cd48e791b81fba670dd009",
"ShouldEvaluateAfterSearch": false,
"Operator": 0,
"Rules": [
{
"RuleType": 1,
"Field": "nofresults:nofresults",
"Condition": "equals or less than",
"Value": "0",
"FieldType": "nofresults",
"FieldName": "Number of Results",
"FieldValue": "0",
"Guid": "0c03ad4d09e94b42929bffc15b86dc5a",
"ShouldEvaluateAfterSearch": false,
"Operator": 2,
"Rules": []
}
]
}
},
"BannerId": 73531,
"CampaignId": 56297
}