#community-help

Filtering Issue with hierarchicalMenu Widget

TLDR Keith experienced a problem while filtering results using the hierarchicalMenu widget. They resolved it by using filters: "break:true" instead of facetFilters. Jason agreed with the solution.

Powered by Struct AI

1

4
6mo
Solved
Join the chat
Apr 13, 2023 (6 months ago)
Keith
Photo of md5-49c23d5dc46241ca1af5233658633765
Keith
06:55 PM
Hey Jason, hoping you can help with something: I have a facet that I’m trying to filer results on, which works well for everything except for the hierarchicalMenu widget for some reason.

Setting filter_by: "breaker:true" under additionalSearchParameters works the the page loads, and when I filter results using a refinementList widgets; but for some reason, the hierarchicalMenu widget loads all my categories and displays all results when a item is selected.

From what I understand, I need to use:
instantsearch.widgets.configure({
    facetFilters: ["break:true"]
})

but I tried this inside and outside of addWidgets([]), so I’m a bit stumped
07:16
Keith
07:16 PM
AH I figured it out: I needed to use filters: "break:true" instead of facetFilters

1

Apr 14, 2023 (6 months ago)
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:43 AM
Yup!
02:44
Jason
02:44 AM
This is a strange quirk in instantsearch…