No Results Search

Please also review:

No results: Use Hawksearch content item and campaign

No results: Use Hawksearch Popular searches and campaign

No results: Use Hawksearch Spotlights and campaign

Overview

In situations where the search keyword yields 0 results, the default search response will have empty “Results” object. You would still get the Pagination, Sorting, Redirect, Merchandising, Featured Items object if applicable.

Retrieving search with 0 results

 

{ "ClientGuid" : "SITE_GUID",    "Keyword" : "abcd123456",    "ClientData":{        "VisitorId" : "2F87556F-AA2F-438E-A52C-AFF4B7E10EB5",      "Custom" : {"some key" : "some value"},        "HttpTrueClientIp" : "some IP address",        "UserAgent" : "some agent",        "Source" : ""    } }

 

Response

 

{ "Facets": [], "VisitorTargets": [], "TrackingId": "119dc96a-aa72-4747-b20a-903d62a447e8", "Success": true, "Pagination": { "NofResults": 0, "CurrentPage": 1, "MaxPerPage": 12, "NofPages": 0, "Items": [ { "Label": "12", "PageSize": 12, "Selected": true, "Default": true }, { "Label": "20", "PageSize": 20, "Selected": false, "Default": false } ], "IsShowFirstLink": true, "IsShowLastLink": true, "NumberOfPageLinks": 4 }, "Keyword": "abcd123456", "Results": [], "Selections": {}, "Sorting": { "Items": [ { "Label": "Product Name (A to Z)", "Value": "nameasc", "IsDefault": false, "Selected": false }, { "Label": "Product Name (Z to A)", "Value": "namedesc", "IsDefault": false, "Selected": false } ] }, "QueryUsedAllKeywords": true, "DocExplain": "", "Redirect": {}, "Merchandising": { "Items": [ { "Zone": "FeaturedLeftBottom", "Title": "No Results Page - Popular Searches", "ContentType": "widget", "IsMobile": false, "IsTrackingEnabled": false, "MobileWidth": 0, "MobileHeight": 0, "Trigger": { "BannerGroupId": 123456, "Name": "Popular Searches", "SortOrder": 0, "Rule": { "RuleType": 0, "Field": "", "Condition": "", "Value": "", "FieldType": "System.String", "Guid": "12348df123456780accaec17d1071234", "ShouldEvaluateAfterSearch": false, "Operator": 0, "Rules": [ { "RuleType": 1, "Field": "nofresults:nofresults", "Condition": "equals", "Value": "0", "FieldType": "nofresults", "FieldName": "Number of Results", "FieldValue": "0", "Guid": "123456786285a64b0eaede45789jhjg42415", "ShouldEvaluateAfterSearch": false, "Operator": 2, "Rules": [] } ] } }, "BannerId": 0, "CampaignId": 123456 } ] }, "FeaturedItems": {}, "SearchDuration": 15 }