Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Disambiguation
This article refers to the front-end integration of your site with Hawksearch through API for engines based on Hawksearch version 2.0L to 4.0L. For HawkSearch 4.0 implementation, please connect with your Hawksearch representative about using the Hawksearch 4.0 Search API here Hawksearch v4.0 - Search API with the front end SDKs described here - Connectors

Table of Contents

Table of Contents

...

https://DOMAIN_URL/ENGINE_NAME/?fn=ajax&f=GetSuggestions&q=KEYWORD&hawkoutput=json

Parameter

Description

Value

fn

Indicates ajax request

ajax

f

The function name to be called

GetSuggestions

q

The keyword. This is the text typed by the user

user-entered alphanumeric value

hawkoutput

Indicates the format of the response

json

Response: Response is a JSON object sent back to the caller.

Expand
titleResponse for GET https://api.hawksearch.info/sites/demo/?fn=ajax&f=GetSuggestions&q=coat&hawkoutput=json
Code Block
languagejson
{
	"Count": 71,
	"ContentCount": 0,
	"PopularHeading": "Popular Searches",
	"CategoryHeading": "Top Product Categories",
	"ProductHeading": "Top 3 Product Matches",
	"ContentHeading": "Top Content Match",
	"Categories": [{
			"Value": "Women &raquo; <b>Jackets</b>",
			"Url": "https://demo.hawksearch.com?department_nest=Jackets_6"
		},
		{
			"Value": "Summer Sale &raquo; Women &raquo; <b>Jackets</b>",
			"Url": "https://demo.hawksearch.com?department_nest=Jackets_7"
		},
		{
			"Value": "Men &raquo; <b>Jackets</b>",
			"Url": "https://demo.hawksearch.com?department_nest=Jackets_4"
		},
		{
			"Value": "Kids &raquo; Girls 5-20 &raquo; <b>Jackets</b>",
			"Url": "https://demo.hawksearch.com?department_nest=Jackets_2"
		}
	],
	"Products": [{
			"ProductName": "Women's Mighty Power Hybrid Jacket",
			"Sku": "\r\n    ",
			"Thumb": "<img class='hawk-sqItemImage-thumb' src='https://test.hawksearch.net/assets/1/14/DimThumbnail/Womens-Mighty-Power-Hybrid-Jacket-White-Heather-Zinc.jpg' />",
			"Url": "https://demo.hawksearch.com/details.aspx?itemid=Item_172279",
			"Html": "<div class=\"hawk-sqItemImage\" ><img class='hawk-sqItemImage-thumb' src='https://test.hawksearch.net/assets/1/14/DimThumbnail/Womens-Mighty-Power-Hybrid-Jacket-White-Heather-Zinc.jpg' /></div>\r\n<div class=\"hawk-sqItemContent\">\r\n<h1 class=\"hawk-sqItemName\">Women's Mighty Power Hybrid Jacket</h1>",
			"Custom": null
		},
		{
			"ProductName": "Women's Whirlibird Interchange Jacket",
			"Sku": "\r\n    ",
			"Thumb": "<img class='hawk-sqItemImage-thumb' src='https://test.hawksearch.net/assets/1/14/DimThumbnail/842215260AC.jpg' />",
			"Url": "https://demo.hawksearch.com/details.aspx?itemid=Item_107149",
			"Html": "<div class=\"hawk-sqItemImage\" ><img class='hawk-sqItemImage-thumb' src='https://test.hawksearch.net/assets/1/14/DimThumbnail/842215260AC.jpg' /></div>\r\n<div class=\"hawk-sqItemContent\">\r\n<h1 class=\"hawk-sqItemName\">Women's Whirlibird Interchange Jacket</h1>",
			"Custom": null
		},
		{
			"ProductName": "Women's Trabagon Rain Jacket",
			"Sku": "\r\n    ",
			"Thumb": "<img class='hawk-sqItemImage-thumb' src='https://test.hawksearch.net/assets/1/14/DimThumbnail/Womens-Trabagon-Rain-Jacket-Watermelon.jpg' />",
			"Url": "https://demo.hawksearch.com/details.aspx?itemid=Item_119547",
			"Html": "<div class=\"hawk-sqItemImage\" ><img class='hawk-sqItemImage-thumb' src='https://test.hawksearch.net/assets/1/14/DimThumbnail/Womens-Trabagon-Rain-Jacket-Watermelon.jpg' /></div>\r\n<div class=\"hawk-sqItemContent\">\r\n<h1 class=\"hawk-sqItemName\">Women's Trabagon Rain Jacket</h1>",
			"Custom": null
		}
	],
	"Content": [],
	"Popular": [{
			"Value": "<b>jackets</b>",
			"Url": "https://demo.hawksearch.com?keyword=jackets"
		},
		{
			"Value": "<b>coat</b>",
			"Url": "https://demo.hawksearch.com?keyword=coat"
		},
		{
			"Value": "<b>columbia </b><b>jacket</b>",
			"Url": "https://demo.hawksearch.com?keyword=columbia%20jacket"
		}
	],
	"SearchWebsiteUrl": "https://demo.hawksearch.com",
	"TrackingVersion": "v2",
	"KeywordField": "keyword",
	"ViewAllButtonLabel": "View All"
}

Parameter

DataType

Details

Count

Numeric

Total products available for the keyword

ContentCount

Numeric

Total content items available for the keyword

Categories

Array of Category Objects

Every category object is a category suggestion:
Value - Name of the category
Url - navigation url

Products

Array of Product
Objects

Based on the request parameter DisplayFullResponse, the product object has all its fields output or the standard autocomplete format

Content

Array of Content Item Objects

Array of content item objects with Value and url properties.

Popular

Array of Popular Searches
Objects

Every popular search term object is an object with these two properties:
Value - Name of the category
Url - navigation url

SearchWebsiteUrl

Url

Base website url for clickable links.
Appended to the Urls present in other object arrays.

TrackingVersion

Alphanumeric text of size 2

v1 or v2 based on your engine version

KeywordField

Alphabetic

Parameter used to denote the keyword field

CategoryHeading

Alphanumeric

Header text for Categories

ContentHeading

Alphanumeric

Header text for Content Items

ProductHeading

Alphanumeric

Header text for Products

PopularHeading

Alphanumeric

Header text for Popular Searches

ViewAllButtonLabel

Alphanumeric

Header text for “View All” link

Example URLs for various environments as follows:

...

HTTP/Keep-Alive

In the event that you see unexpected timeout errors from the site when testing, please confirm your http web request settings for the request you make to hawksearch. In some cases, the clients reset the connection instead of leaving it in Time_Wait/Close_Wait causing IIS to log it as an interruption. In this scenario please force the request to be Http 1.0 with no keep alive and see if timeouts no longer appear.

...