instantsearch
instantsearch copied to clipboard
hierarchicalMenu checkbox option
Feature request
Is there any way to have a hierarchicalMenu that shows the lowest level children as a checkbox list rather than a link list, in the same way that a refinement list works? Maybe this is already possible, but I've had a look and a search and can't come across a way of doing it.
Even if you could offer some pointers in how to go about it, I should be able to write the code myself.
Thanks
Hi @ryanmitchell thanks for taking the time to open this issue. Can you give more details about the behaviour that you expect beyond having checkboxes? Would you like to be able to select multiple items in the hierarchy?
Hello
Yes it would need to be able to multi-select. Effectively we are trying to do a refinementList but with a hierarchy, allowing us to have grouped lists for refinement rather than one big list.
On 8 Dec 2016, at 13:20, Alex S [email protected] wrote:
Hi @ryanmitchell https://github.com/ryanmitchell thanks for taking the time to open this issue. Can you give more details about the behaviour that you expect beyond having checkboxes? Would you like to be able to select multiple items in the hierarchy?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/algolia/instantsearch.js/issues/1658#issuecomment-265738065, or mute the thread https://github.com/notifications/unsubscribe-auth/AADKu5mn_vkv4jYhM0678aYi8QvqqSslks5rGAQ3gaJpZM4LEAPw.
Thanks for the details, @ryanmitchell It is not possible as for now.
No problem - if I was to work on it would it be of interest to you as a PR?
On 8 Dec 2016, at 16:10, Alex S [email protected] wrote:
Thanks for the details, @ryanmitchell https://github.com/ryanmitchell It is not possible as for now.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/algolia/instantsearch.js/issues/1658#issuecomment-265779366, or mute the thread https://github.com/notifications/unsubscribe-auth/AADKuzlLhsqro5U2TLpHRdk8BqXSz3Pgks5rGCvrgaJpZM4LEAPw.
@bobylito Just one further question - is there any way of getting the complete hierarchy with the number of results per item? Currently I can only get the main root plus the level i've refined to, but ideally I'd like to be able to get everything. Otherwise its back to the drawing board.
Do you mean you would want to show the hierarchical menu with every menu item opened showing the whole tree at start?
I know this is an older ticket but I would like to know if it's possible to do that last suggestion: show the full tree at the beginning rather than having to click down to see the lower levels.
Hey @hereswhatidid, that information is actually not readily available at initial rendering, because each of the lower levels would have to do another query.
For that reason an “opened” hierarchicalMenu isn’t simply possible.
A disjunctive (multiple items checked possible) might be possible however, but as discussed in https://github.com/algolia/instantsearch.js/issues/2053, this needs a lower level solution in the helper.
Feel free to give it a try though!
Gotcha, thanks!
Closing in favour of #2053
never mind, this is the only issue open on disjunctive hierarchicalMenu (aka hierarchicalRefinementList) for is.js
@ryanmitchell - Were you able to come up with a way to do this? Basically I need an instantSearch widget as you described. One that allows the user to make multiple selections.
For example, if a hierarchy is States and the cities in those states, the user wants to be able to select multiple cities. The hit container would then display those items that have all the cities ANDed together.
One modification I have been attempting to do is I am trying to see if each time I click on on item in the hierarchicalMenu it would just keep adding to the refinement list instead of the current behaviour where the next one I click removes the previous refinement.
Any advice you or anyone has would be appreciated.
I ended up storing the list of categories in a normal SQL database and then outputting that aspect outside of instantsearch, with an onchange event in JS to update instantsearch results.
On 2 Jun 2017, at 00:58, slimtimbodin [email protected] wrote:
@ryanmitchell https://github.com/ryanmitchell - Were you able to come up with a way to do this? Basically I need an instantSearch widget as you described. One that allows the user to make multiple selections.
For example, if a hierarchy is States and the cities in those states, the user wants to be able to select multiple cities. The hit container would then display those items that have all the cities ANDed together.
One modification I have been attempting to do is I am trying to see if each time I click on on item in the hierarchicalMenu it would just keep adding to the refinement list instead of the current behaviour where the next one I click removes the previous refinement.
Any advice you or anyone has would be appreciated.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/algolia/instantsearch.js/issues/1658#issuecomment-305652301, or mute the thread https://github.com/notifications/unsubscribe-auth/AADKu_0hziJkKY8Svvyd7i8YU0r7tcQAks5r_1AcgaJpZM4LEAPw.
+1
I’ve ended up here a few times now. This seems to be a search paradigm that we keep coming across.
@joshuabaker, feel free to upvote the original issue 😄
@ryanmitchell I have the same issue - is there any chance that you could share some of your code and save me from reinventing the wheel?
@piersb - nothing to share really. We just output the refinements using SQL and then using an on change event added or removed them from the refinement list. Pretty simple stuff.
Ta.
I have faced the same issue. Basically, In my application, an Entity can have multiple categories. So for searching through these categories, I need to implement multiple category selection features. Is there a way to do this?
For now there's no way to do this in the Algolia backend. A solution could be found by combining refinement lists to make a new kind of hierarchical refinement instead
One problem I am facing here. I have indexed the category details in agolia. But I am not able to form the hierarchical menu on the frontend
My data set is
Config
One problem I am facing here. I have indexed the category details in agolia. But I am not able to form the hierarchical menu on the frontend
@sandipbhuyan Is your problem related to the checkbox issue? Or is it a general enquiry on how to user the hierarchical menu?
I've written a little custom version of the menu that could probably be extended into this functionality. Dropping it here now, might pick it up further myself later.
https://gist.github.com/jasperkennis/977b2638068082800a473473d6d48222
You have my vote as well.
Is there any workarounds for the original request: multi-select with checkboxes?
I don't see a solution that plays nice with the intended usage of instantsearch, or even the actual search logic of Algolia.
So far, the only solution I can come up with is the following (and I don't feel like programming this...). I think you could clone your entire instantseach intance when a user wants to filter for more then one hierarchical attribute, so you end up with several queries ran paralel. The results should then be combined through some kind of merge, rendering the result with some abstraction of the "normal" widgets.