Versions Compared

Key

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

...

The autocomplete feature can be integrated through API similar to the search functionality. Hawksearch sends the response in JSON format which can be consumed by your website and displayed appropriately.


Request format: GET request made through a URL built as follows:

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. Response for sample request as above

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"
}

...