Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Dynamic multifilter

Avatar

Level 8

I would like to be able to build a dynamic multifilter component. Some of these multiple criteria come from AEM Tags and some can be dates and/or time. The idea is when one tag is selected then the next filter opens with more selection then the next and so on. The result from this filtering pattern is a list of resulting resources that meet all the selected criteria. The selected criteria can me written/read from the URL.

What would be a good approach to bild a dynmaic filter pattern that I could use for filtering different types of resources?

4 Replies

Avatar

Community Advisor

If the data is in AEM using querybuilder API with proper indexed data should work fine.

Make a custom servlet which call the different service layers depends on the filter and retrieve those back to front end as JSOn object and make every subsequent call be an asynchronous call to the servlet.

 

Avatar

Level 8

Thanks a lot @Mani_kumar_ 

Can you please elaborate what you had in mind when you write "call the different service layers depending on the filter"?

Yes, all the information is in AEM. All the tags and dates are properties of the resources I would like to filter.

Avatar

Community Advisor

1. Write servlet which is common to all the filter 

Ex: /aem/search/servlet

2. Servlet should be responsible for capturing the type of filter user selected (filter1, filter2)

3. Based on the filter/filters selected have a service with different query builder queries.

4. Map the result back to UI

 

Based on my understanding I hope this is what it works

Let me know if you need more information we can connect directly.