Developer forum

Forum » Development » Filtering in Ecom

Filtering in Ecom


Reply
Hi,

I have setup the instant Ecom search on a website and I want to have the search only search in one single group in Ecom. Right now the instant search is searching in all the groups in Ecom.

I have tried to make a search filter but it won't work with my instant search.

What to to?


Replies

 
Nicolai Høeg Pedersen
Reply
Try having a look at the last paragraph in this article:
http://volpav.wordpress.com/2010/11/23/new-search-in-dynamicweb-instant-search-and-suggested-queries/
 
Reply
Hello,

As Nicolai mentioned you can workaround this by configuring additional filters that will apply to your query and therefore narrow your search results.

If you want only the search box to be displayed and the group filter to be applied automatically you can use the "Delimit" filter:

1.   Go to Management Center -> eCommerce -> Product catalog -> Search filters.
2.   Create a new filter group with two filters in it:
2.1. A "Delimit" filter with the following settings: Field = Groups, Value = [an ID of the desired group]
2.2. A "Free text search" filter with the advanced template (TextFilterAdvanced.html).
3.   Go to paragraph settings of your eCom catalog module and choose the filter group you just created. Also make sure you use the "simple" search template ("SearchForm.html"). Also make sure that you have put a template tag that corresponds to your free text search filter in this template.
4.   View the page in the frontend. The "Instant search" functionality should now only show the products from one group. The "suggested queries" although can't be configured this way (it will always search within the entire index). 

P.S. We have created a work item for this. You will be able to configure your "instant search" (as well as "suggested queries") functionality to respect all paragraph settings (and not only the some of them as it is right now). The fix will be available with the next service release (but, maybe earlier - it's not decided yet).
 
Reply
Hi,

thanks for your answers.

In point 2,1 I have to input an ID of the desired group.

I have tried to input "GROUP6" and the search field is shown and works but I still get products from other groups?
See attached image.
Skærmbillede 2011-01-26 kl. 10.49.30.png
 
Reply
Hello,

Can you provide us with the link to the page ?

-- Pavel
 
Reply
 Yes, the link is:
http://soulmate.net.dynamicweb.dk/Default.aspx?ID=126
 
Reply
Hello,

You're actually using "Suggested queries" instead of "Instant search". As I mentioned it's not possible to make the above trick work with "Suggested queries" (we're working on fixing this issue).

In order to enable "Instant search" functionality please do the following:

1. Go to Management Center -> eCommerce -> Product catalog -> Search filters
2. Find your "free text search" filter and open the corresponding template for editing ("TextFilterAdvanced.html", click on a small green button next to the drop-down list).
3. Find the following function call: Dynamicweb.Frontend.InstantSearch.setEnableSuggestions. Comment it out.
4. Find the following function call: Dynamicweb.Frontend.InstantSearch.setEnableInstantSearch. Uncomment it (commented out by default).
5. Save the template. View the page in the frontend.

Let us know if this helped.

-- Pavel

 
Reply
Arh okay, now I think it works, I don't get products from other groups now when I search.

Thank you very much :)

 

You must be logged in to post in the forum