Hi,
We notice the results we get in our suggested search are correct but not as you would like them to be. Just take a look at the site (http://www.cookandco.nl/) and start searching with just 1 letter (for example the letter b). You will see all products that contain this letter but the first results look rather random to us (first result is Neo Berghoff). It makes sense to show products that start with the letter "b". Does anyone know a way to influence this result?
Developer forum
E-mail notifications
Relevance in ecom suggested search
Matthijs Hofstede
Posted on 20/12/2011 12:00:35
Replies
Pavel Volgarev
Posted on 20/12/2011 12:38:35
Hi Martthijs,
The reason why you get this product is that the system takes not only the product name into consideration but all the fields that contain any text (for example, short/long description). Furthermore, such fields are tokenized before they're put into the index meaning that you can't really search for something that starts with a given word or phrase. A search for "b" will find all products that contain the letter "b" as a standalone token. A search for "b*" will find all products that contain a token that starts with a letter "b" and so on.
You can change the order of your products (or event remove results that you don't want to show) by subscribing to Dynamicweb.Notifications.eCommerce.ProductList.BeforePaging notification.
-- Pavel
The reason why you get this product is that the system takes not only the product name into consideration but all the fields that contain any text (for example, short/long description). Furthermore, such fields are tokenized before they're put into the index meaning that you can't really search for something that starts with a given word or phrase. A search for "b" will find all products that contain the letter "b" as a standalone token. A search for "b*" will find all products that contain a token that starts with a letter "b" and so on.
You can change the order of your products (or event remove results that you don't want to show) by subscribing to Dynamicweb.Notifications.eCommerce.ProductList.BeforePaging notification.
-- Pavel
Pavel Volgarev
Posted on 20/12/2011 12:57:02
Hi Martthijs,
Sorry, I misunderstood your question a bit. The notification that I mentioned in my previous post will not help you because it's not fired in this case.
What you can do is you can filter results on the client using JavaScript. Open your template that contains the setup for Instant Search (usually it's either /Files/Templates/Filter/TextFilterAdvanced.html or /Files/Templates/Filter/TextFilterSuggestions.html) and edit the section that initializes the Suggested Queries functionality the following way:
Here I use "itemDataBound" event to determine if the item can be shown in the list.
Hope this helps.
-- Pavel
Sorry, I misunderstood your question a bit. The notification that I mentioned in my previous post will not help you because it's not fired in this case.
What you can do is you can filter results on the client using JavaScript. Open your template that contains the setup for Instant Search (usually it's either /Files/Templates/Filter/TextFilterAdvanced.html or /Files/Templates/Filter/TextFilterSuggestions.html) and edit the section that initializes the Suggested Queries functionality the following way:
Dynamicweb.Frontend.InstantSearch.setEnableSuggestions('txFreeTextQuery', true, { boxID: 'divSuggestions', onItemDataBound: function(sender, args) { var canShow = true; var suggestion = args.data; /* Filter out results here */ if (!canShow) $(args.item).hide(); } });
Hope this helps.
-- Pavel
Matthijs Hofstede
Posted on 20/12/2011 13:20:04
Hi Pavel,
Thanks for your quick reaction. It sure helps.
If i understand you correct in your example you exclude some off the items with javascript (for example everything not starting with the letter you just typed)
And you can not influence the order off the results?
Matthijs
Thanks for your quick reaction. It sure helps.
If i understand you correct in your example you exclude some off the items with javascript (for example everything not starting with the letter you just typed)
And you can not influence the order off the results?
Matthijs
Pavel Volgarev
Posted on 22/12/2011 09:34:49
Hi Matthijs,
I'm sorry, but it's not possible right now.
-- Pavel
I'm sorry, but it's not possible right now.
-- Pavel
Matthijs Hofstede
Posted on 02/01/2012 14:52:25
Hi,
Can you guys look into it and make it a feature request? Imho you would like to have something to sort the results. The results you get now are not the ones a user would expect. Expeccialy with a hight number of products.
If it will be marked as a feature request could you post the number for future reference?
Gr. Matthijs
Can you guys look into it and make it a feature request? Imho you would like to have something to sort the results. The results you get now are not the ones a user would expect. Expeccialy with a hight number of products.
If it will be marked as a feature request could you post the number for future reference?
Gr. Matthijs
You must be logged in to post in the forum