Posted on 21/11/2014 21:03:06
You can call the InstantSearch.ashx in an ajax request and get some suggestions, but I don't think it will give you the results you are looking for.
I think it would be better to actually include the terms that users are searching for in the description or meta data on each product, so that these products show up in the search results.
Example 1: Suggestions when there are matching products
{
"Data": ["Road Bike", "Mountain Bike", "Commuter Bike", "BMX Bike", "Coasting Bike"],
"ExtensionData": [{
"Name": "PageID",
"Value": "48"
}, {
"Name": "ParagraphID",
"Value": "34"
}, {
"Name": "Module",
"Value": "eCom_Catalog"
}, {
"Name": "Time",
"Value": "635521978558370396"
}, {
"Name": "Formatter",
"Value": "JsonDataFormatter"
}, {
"Name": "FormatterContentType",
"Value": "application\/json"
}]
}
Example 2: Suggestions when there are no matching products
{
"Data": [],
"ExtensionData": [{
"Name": "PageID",
"Value": "48"
}, {
"Name": "ParagraphID",
"Value": "34"
}, {
"Name": "Module",
"Value": "eCom_Catalog"
}, {
"Name": "Time",
"Value": "635521978023251512"
}, {
"Name": "Formatter",
"Value": "JsonDataFormatter"
}, {
"Name": "FormatterContentType",
"Value": "application\/json"
}, {
"Name": "OriginalPhrase",
"Value": "bikes"
}, {
"Name": "CorrectedPhrase",
"Value": "bikers"
}]
}