Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Equivalent for group specific filters with the new index

Equivalent for group specific filters with the new index

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

When using the new index, is there an equivalent of the "filter visibility" for specific groups that existed in the old index? I am looking into a way of having facets show up based on product categories so I can show filters / facets that belong to a specific ecommerce group only. Is there any documentation on this subject you can point me to?

Thanks!


Replies

 
Nicolai Pedersen
Reply

Hi Imar

There is no such thing - in the old index the search was closely related to the groups.

Groups in the new index is just yet another criteria and could as well be &GroupID=group1,group2 - and in most cases you would have products from more groups, i.e. when doing freetext searches.

Instead of defining visibility, we made it so if a facets that does not have valid options in the current context can be hidden.

So if you define facets on 3 different fields, i.e. price, wheel size (a field on a bike category) and size (the size of a piece of cloth from a cloth category), when you go to a Bike group you will see only 2 facets (Price and Wheel size) and if you go to a cloting group, also see 2 facets (Price and clothing size).

But maybe you could explain the scenario so I can understand?

You can probably do something by code. The Notifications.eCommerce.Querying.AfterQuery notification have a Notifications.eCommerce.Querying.AfterQueryArgs object that contains a Settings property of type Dynamicweb.Querying.QuerySettings. That one have a Facets property which is a collection of the facets defined for this instance of the catalog on the paragraph settings. So if you include all facet groups in that list, you can remove the unwanted ones by a custom ruleset in a notification subscriber.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I will continue to add scenarios to this thread to be consistent (thanks Nicolai for pointing it out for me)

My scenario is this:

A product is assigned to 2 separate categories, each category having 2 separate sets of Product Category Fields.

If I go to Category 1, I want to see only the Facets defined for Category 1 without the facets defined for Category 2 even if there is at least one product in Category1 that has values for both sets of Facets.

Is this how it is happening now? 

Thanks,

Adrian

 
Nicolai Pedersen
Reply

This is how things are happening now... And I see no solution for it.

You can define different facet groups on the same search. You can add them to the paragraph where the catalog is. So you can have a page for each group so you can define it there (really bad idea), or in your template add rules on hiding/showing groups based on the groupid.

If a user searches for "product name", you will have something like /products?q=blue in the URL. It will show blue bikes and blue shirts. Which facets should be shown if you have facet display rules on your product groups?

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I agree that having separate ProductCatalog pages for each category is not a good ideea. Been there, done that, no thank you.

If I have an option to filter the facets in the template based on CurrentGroupID and facet type, I think it is fine. I will be able to support both scenarios (SearchResult and ProductList) by using a different Facets template and avoid any interference with core code.

This means that I need a GroupID property on each Facet (coming from the connection between the ProductCategory and ProductGroup and another property that defines if it's a ProductCategoryField based Facets or a general facet (Variants options, or regular ProductField Facet).

Would that work?

Thanks,

Adrian

 
Nuno Aguiar
Reply

Hi Adrian,

 

Unless I missinterpreted what you need and I may be saying the same thing you did, but what if you develop an Index Builder Extender to flag/categorize every document based on what you need. For example:

  • Product type specific = Bike, Clothes, Accessories or Gadgets
  • You'd create a facet for that field
  • Based on the available facet options you'd show/hide the facet groups

 

Meaning: If you have "Clothes" as a facet options, it means your product list has "Clothes" and you can show the facet group related to clothes.

 

Best Regards,

Nuno Aguiar

 

 

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nuno,

Of course, this can be another workaround for the new index. This will not work for the old index. And I am talking about tens of subcategories with at least 5 facets for each subcategory. Even the creation of the facets and the entire query is a nightmare because we need to figure out a way to create them dynamically based on some other conventions because the products have some atributes that have to be used as facets and some attributes that are only displayed in the product template. And there have to be ProductField based facets and ProductCategory based facets and probably VariantBased facets. And moreover, I need to figure out a way to sort the values in a way that should not be based on the Facet values. And I cannot ask the customer to do that in the back-end, because they simply don't have an easy interface for that.

Oh, and on top of that, I need to be careful about the system names used for facets in order to avoid upseting the SEO experts.

It does not sound like an easy thing to accomplish without getting my hands dirty.

Thanks for the suggestion anyway. It might actually be the only option available

Adrian

 
Nuno Aguiar
Reply

Hi Adrian,

 

Uuuu fun... Good luck with that.

If you find a pattern as to creating the facets and queries (and/or index fields) we've done a custom development for another customer where we took a bunch of data and generated the necessary XML files for the Repository (overcomming human error prone mistakes related to repetitive and/or large data).

 

Best Regards,

Nuno

 

You must be logged in to post in the forum