react-instantsearch
react-instantsearch copied to clipboard
Feature-Request: Hierarchical Menu as a disjunctive facet
Need Hierarchical Menu that is disjunctive. react-instantsearch 3.2.1 is current;y being used Similar to Refinement List but in a tree format.
Use case when be when filtering by location and want to have multiple locations possible.
EX.
Index has record attribute... record 1
geography: {
lvl0: "North America",
lvl1: "US",
lvl2: "MI"
}
record 2
geography: {
lvl0: "Asia-Pacific",
lvl1: "China"
}
Hierarchical Menu only allows one to be selected, need to be able to expand both North america and Asia-pacific and filter by Asia-Pacific>China or North America>US
:+1:
Just for reference, we do hear you, but this is very complex to achieve. It's in our longer-term road map. Feel free to react with 👍 to the original post so we can sort this by amount of people requesting the feature
Hey, just wondering if there have been any updates that resolve this issue? @Haroenv you mentioned this being on the longer-term roadmap? 🗺
I've arrived here from the closed issue in the instantsearch.js repo as I'm trying to achieve the same result - a multiselect hierarchical menu. Definitely feels like there's a solid use-case for it so would be brilliant to see it added to such a comprehensive library 👏
Thanks!
Hey @pragmatic-tf, we discussed this for our roadmap this quarter, but decided not to because this would have a lot of requests (one for every open level + 2) and require us to rebuild one of the most complicated parts of the code.
However one of our solution engineers (@rgalite) made a workaround for InstantSearch.js using multiple hierarchical menus to allow this for the root level: https://codesandbox.io/s/instantsearchjs-disjunctivehierarchicalmenu-zl3rm with the same number of requests tradeoff
Hi @Haroenv the example above no longer works with instantsearchjs 4.0 and above. Has there been any developments in implementing a working widget for this?
You're right, the widget indeed doesn't seem to work anymore in InstantSearch v4, although I'm not sure what caused it to fail
I've done a trial at upgrading, but got stuck here: https://codesandbox.io/s/instantsearchjs-disjunctivehierarchicalmenu-zl3rm?file=/src/custom-disjunctive-facets.js, I'm assuming it tries to read from the wrong results or something like that.
At the moment we haven't seen this as a priority, but would love to hear what your tradeoffs are for this widget @dianos. What experience do you want to create?
Hi @Haroenv, it appears that before an array of values for the 2nd level was being returned, while right now an object is returned but it's also missing the 2nd level values.
I'm trying to have the Hierarchical Menu display attributes and allow the selection of multiple attributes, it does work very well for displaying them, but you can currently only select one.
Your example worked up to version 3.7 of instantsearchjs. Changes done in version 4.0 broke it.
Our team could really use this feature. Haroenv if this is possible to fix the workaround or update Algolia, my team would greatly appreciate the effort!
Hey there @khahn-hw I think I made it work. In the custom-disjunctive-facets.js file, try adding this line to the init method right below this.helper = helper
.
helper.state = this.helper.state.addDisjunctiveFacet(this.lowlevelAttribute);
Moving this into a Discussion since this is a feature request and not a bug.