meilisearch-js-plugins icon indicating copy to clipboard operation
meilisearch-js-plugins copied to clipboard

Filter selection removes other filters, add OR in refinementsList

Open ThisIsMyFavouriteJar opened this issue 4 years ago • 16 comments

Hello, enjoying Meili quite a lot but running in the following issue. I have a list of products, each with a single brand linked to it:

image

When I select a single filter everything works fine, but all other filterable options disappear immediately: image

Is it possible to select a filter, and still display all other filterable options? Basically enabling people to select more than 1 brand and then applying an OR in the search? So after I selected Miele I still want Siemens and Bosch and the other values be displayed!

Thank you!

ThisIsMyFavouriteJar avatar Nov 12 '21 15:11 ThisIsMyFavouriteJar

Hello @ThisIsMyFavouriteJar This is something that needs to be implemented in instant-meilisearch!

For the moment we only do AND but we should be able to retrieve the OR settings that can be passed on through here:

Also unfortunately I cannot guarantee you will be able to see the 0 until we implemented disjonctiveFacetSearch.

bidoubiwa avatar Nov 15 '21 11:11 bidoubiwa

Hi @bidoubiwa,

Is this on the roadmap for the foreseeable future? And is there a possible way to work around this for now?

jasperjorna avatar Nov 16 '21 23:11 jasperjorna

Unfortunately, I don't think it is possible. I have to finish some other tasks before I can look at this improvement. If you want to make a contribution I can help you in the process and show you where things should be changed

bidoubiwa avatar Nov 17 '21 11:11 bidoubiwa

Hey, I would be interested in working on this feature if no work has been started yet. Would appreciate any advice you have.

dezyh avatar Nov 25 '21 01:11 dezyh

Hello @dezyh and @ThisIsMyFavouriteJar

After rethinking about the problem their are two that are raised by this issue:

OR operator

I tried it again and in fact it works. I'm sorry for misleading you. You need to change the operator in your refinmentList widget. Example in react:

<RefinementList attribute="genres" operator="or" />

Do not hide the other values

This part may not be possible as it is due to MeiliSearch design. If you would like to see this options implemented in MeiliSearch could you start a discussion here: https://github.com/meilisearch/product/discussions/categories/feedback-feature-proposal. The designers of the API loves to receive feedback on how to help users get the results they want.

bidoubiwa avatar Nov 25 '21 19:11 bidoubiwa

Hi everyone! 👋

I've created a product discussion for that particular pain point here. Feel free to add your hints and elaborate on this. 😇

While the way we calculate the facet distribution today is not done in the most obvious and convenient way for end-users, we also have a product discussion on this topic that might interest you here.

We are in the process of establishing the 2022 roadmap and we will certainly work on the facets. Thanks for your feedback.

gmourier avatar Nov 26 '21 09:11 gmourier

@bidoubiwa it seems that even I apply operator="or" values start missing. Try with the brand facet here

paligiannis avatar Mar 12 '22 11:03 paligiannis

~Hello yes, unfortunately this is disjonctive facet search when working between different facets. This is something that must be implemented either in instant meilisearch or meilisearch itself. I need to create a detailed issue explaining what needs to be done.~

bidoubiwa avatar Mar 12 '22 15:03 bidoubiwa

Hi @bidoubiwa i will someway implement if now and I will update you soon if there is any temp solution

paligiannis avatar Mar 13 '22 16:03 paligiannis

@bidoubiwa Why on v0.6 seems that this is implemented? Screenshot 2022-03-14 at 10 52 11 AM

paligiannis avatar Mar 14 '22 08:03 paligiannis

Hello! When using or it is between two values. For example in a product facet if you click on both shoes and shirts you will see all documents containing both shoes or shirts. But all the other ones will be removed.

What are you expecting? That the other fields stay but with a 0 value?

bidoubiwa avatar Mar 16 '22 13:03 bidoubiwa

Hi! Yes, with or statement all values should be accessible to the user, to select for example the facet with value A, B, C, and all the values should remain in the facet area.

paligiannis avatar Mar 17 '22 17:03 paligiannis

This should fix it #695

bidoubiwa avatar Mar 17 '22 17:03 bidoubiwa

I see that you are preparing a new pull request and I was wondering from the first place how is that possible for the user to select other value if the values got hidden.

paligiannis avatar Mar 19 '22 09:03 paligiannis

I'm providing this solution as a work-around for Meilisearch's behaviour. As this is a decision from the Meilisearch engine itself. I suppose that if a value is at 0 there will be no effect on selecting that value. While if the value is still visible that means that there is at least one document, thus selecting that value adds search results. It is a practice often seen in websites I suppose because it reduces the attributes number and makes it easier for the user to see the options still relevant in its current search.

Could you ask the question and give feedback here: https://github.com/meilisearch/product/discussions/315 That would help @gmourier understand why this design choice is not working for you!

bidoubiwa avatar Mar 21 '22 09:03 bidoubiwa

Keeping this open to keep track of disjunctive facet search

bidoubiwa avatar Mar 21 '22 12:03 bidoubiwa

The disjunctive search beta is released! The search should behave the way you expect it.

Can you try it out? It is published on npm here

bidoubiwa avatar Dec 15 '22 16:12 bidoubiwa

I suppose it answered your needs :)

bidoubiwa avatar Feb 23 '23 14:02 bidoubiwa