meilisearch-js-plugins: "or" operator doesn't seem to work within a refinement list (disjunctive facet search).
Hi 👋
Description
“or” operator don’t work within a refinement list.
Current behavior
When I click on a refinement list, only the options that have a document in common with the option selected are shown - even if the refinement list is set with the “or” operator.
So - when I have a refinement list with exclusive options (ie. none is shared by a document - in a belong_to/has_one association), I can only display a single option within the refinement list.
But - with the “or” operator, I’d like to see other options as well that I can select, so I can select two different options from the refinement list and see the documents that have either one or the other.
Screenshots or Logs
searchBrands.addWidget(
panelForIndustries({
container: "#categories",
attribute: "industry.name",
showMore: true,
autoHideContainer: true,
keepZeroFacets: true,
operator: "or"
})
);
Behaviour - I have industries to search on brands. Each brand can only have one industry.
Before selecting anything:
Here’s what I’d like as a result (using Algolia, which set the default operator as “or” - so I can select and view results from two different industries - as I would expect using the “or” attribute)
Here’s the actual result by Meilisearch (the default operator being “and” - and the setting in the RefinementList doesn’t seem to work)
Environment (please complete the following information):
- Meilisearch version: MeiliSearch 0.27.1
- instant-meilisearch version: https://cdn.jsdelivr.net/npm/@meilisearch/instant-meilisearch/dist/instant-meilisearch.umd.min.js
- instantsearch.js version: InstantSearch.js 4.43.0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 23 (9 by maintainers)
Commits related to this issue
- Merge #888 888: Add multi index and disjunctive facet search r=bidoubiwa a=bidoubiwa ⚠️ NOT working with `keepzerofacet` Using the `Index` widget, it is now possible to do mult-index search, se... — committed to meilisearch/meilisearch-js-plugins by meili-bors[bot] 2 years ago
- Merge #888 888: Add multi index and disjunctive facet search r=bidoubiwa a=bidoubiwa ⚠️ NOT working with `keepzerofacet` Using the `Index` widget, it is now possible to do mult-index search, se... — committed to meilisearch/meilisearch-js-plugins by meili-bors[bot] 2 years ago
Working on it for the moment! We have been slowed down with hacktoberfest unfortunately
The disjunctive search beta is released! Can you try it out? It is published on npm here
Hey @anthonycook, I’m currently working on it 😃 Both multi-index search and disjunctive facet search are being added simultaneously.
You can follow along #888 Which introduces the multi-index search, and should be a gate opener to adding disjunctive very efficiently
Hey @jeremylynch. It is the next task we are working on 😃 I’ll keep you updated
This is a pain point for us too.
We have “or” based filter
This is the
refinement list
without any filtersWhen we select 1 this is what we would see (notice other options becoming
0
)But in fact, the
document
count available is not0
but6
since this is an “or” based filter. When we selectdocument
as well, our total search hits become 10 (6+4):This is what we expect to see: (filter count available, not filter count in current hits)
Hello @johnwbaxter I cannot guarantee any time for the moment unfortunately 😕 I will try to create the issue explaining in details how it should be implemented asap so that contributors may implement it if they want it to be released sooner
Sorry for my question, and maybe it’s a stupid question, but when will this feature be available, would be happy to use it in existing project. Thanks!
Is there any idea of when this issue will be resolved? Thanks!