Developer forum

Forum » Ecommerce - Standard features » How do i implement a Did you mean-feature

How do i implement a Did you mean-feature

Sonni Tost
Reply

Hi all,

I would like to implement a 'Did you-mean'-feature in my product search - but i fail to find documentation on how to do it.

I have found some documentation on the subject (Pavel Volgarevs blog) - but when i try to use the DwTemplateTags in my templates - it shows just about all the tags in the world - except the tags he mentions in his post.

Can anyone point me in the right direction as to how i implement the 'Did you mean'-feature in the product search?

It will be highly appreciated :-)


Sonni T.


Replies

 
Morten Bengtson
Reply
This post has been marked as an answer

Hi Sonni,

You can use the "No products found" template on the product catalog.

Here is an example of 'Did you mean?' from the solution set.

Make sure that products have been indexed and that you are using the index search (Lucene) on the product catalog page.

Live demo

Votes for this answer: 1
 
Morten Bengtson
Reply
 
Sonni Tost
Reply

Thank You Morten!

That was the missing link :-)

A tiny follow-up question:
Is there a way to suggest an alternative query - even though a search returns results?

Fx. if a client searches for a product in plural - and that search returns 6 hits - but the same search in singular returns 70 hits. Then it would be beneficial to suggest the same search in singular.

Or would that be a feature request?

Kind regards

 

Sonni T.

 
Morten Bengtson
Reply

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

 

You must be logged in to post in the forum