Dynamic widgets or hundreds/thousands of conditionally displayed refinementlists

I am not sure what the best practice approach would be for the requirement to conditionally display a set of refinementlists based on the selected Hierarchical menu item as one drills down the menu tree for hundreds of different facets.

We have more than 2,000 different product classes nested under a roughly 3 to 4 level menu tree.
Most of the product classes are very technical scientific equipment and are going to have very specific and different descriptors (attributes) that describe them. They will have not have very many attributes in common.

for example:

  • Home>Laboratory > Microscopy > Stereo Zoom Microscopes
  • Home> Semiconductor Manufacturing> Wafer Fabrication > Chemical Mechanical Planarization > CMP Polishers

Where a Stereo Zoom Microscope class will have a refinement like:
Binocular Angle with options such as:

  • 45 deg Eyelevel
  • 60 degrees
  • Ergonomic
  • Coxial

and a CMP Polisher will have a refinement like:
End of Process Detection with options like

  • Audio
  • Piezoeletric
  • Timed
  • None

If you consider that each product class might have up to 5 different facets for filtering for all of our 2,000 different classes, then there would be be a need to configure about 5x2000 = 10,000 different attributesForFaceting .

of course and in addition, these class "appropriate " refinemenlists would need to be conditionally displayed only when the corresponding class is navigated to in the HiearchialMenu…like the Binocular Angle when navigating to Stereo Zoom Microscopes in the example above., otherwise it is hidden.

I have seen this post below about using the hidden function of a panel which looks like one possible solution, but I am not sure if this the best approach for so many refinementlists:
https://discourse.algolia.com/t/conditionally-display-refinement-list-depending-on-selected-hierarchical-menu-item/9446

I looked into DynamicWidgets but I am not sure if this does anything to help offset the need to create such a high count attributes that I have to create and maintain.

another idea was to have generic refinements that create or assign the attribute in real time (and later destroy it? not sure if this is even possible.

What is the best approach to accomplish what I need to do? are there any performance/cost considerations to this?

Thanks

What we have done (mage2):
Do not configure the facets by hand, but rather have some code autogenerate the facet configuration based on their attribute type / settings.
Then remove facet config from admin view, as this crashes the browser.
Algolia will only show the facets that are used based on the products in the current (hirarchicla, but also other) facets. As such, this mapping to the "“appropriate " refinemenlists” is done automatically.

@alex1
Thanks for that. I was wondering if might elaborate on what you mean. I am not quite following your approach. not understanding what is crashing the browser?

Furthermore:

Algolia will only show the facets that are used based on the products in the current (hirarchicla, but also other) facets. As such, this mapping to the "“appropriate " refinemenlists” is done automatically.

That is true, but would this not also result in the union of all the facets being shown of very disparate product classes contained under broad top level menu items? This could result in 100’s of facets being shown for the underlying product classes that have little or nothing in common.
eg:
Semiconductor Manufacturing Equipment is a root menu item… it has 10-20 immediate children underneath it which in turn each could have 3 or 4 more levels down.
an Xray Diffractometer under Wafer Manufacturing is one example of a path as is a CMOS Latch-up Tester under Reliability and Testing equipment

These 2 product classes have absolutely nothing in common and as such I would never want to see the see the facets for each of these product types show up together when clicking on the top-level Semiconductor Manufacturing Equipment menu item of the HierarchicalMenu widget.

Would this not occur with what you are proposing?

Hi,
Crashing the browser: Algolia config in mage 2 admin menu renders select boxes for each facet. If that exceeds a few hunderes, the DOM size will blow up what chrome can handle.

Yes, the top level category would than be a problem, and I guess you’d need to tweak the frontend JS. I guess it makes sense to just not show most facets at all when on higher category levels.