instantsearch
instantsearch copied to clipboard
Wildcard doesn't work on facets, if disjunctiveFacets are declared
If I do
var helper = algoliasearchHelper(client, 'indexName', {
facets: '*', // or facets: ['*'],
disjunctiveFacets: ['brand']
});
I only retrieve the facet "brand". Since I passed the wildcard to facets, I'd like to retrieve all facets, but only have the "brand" as a disjunctive facet.
This bug is only existing when a disjunctiveFacet is passed.
Hey @kokliKo thanks for the bug, I'll look into it ASAP. Just for my information, why can't you enumerate the facets? Do you want brand to be both disjunctive and conjunctive?
Thanks!
- "Why can't you enumerate the facets" -> I'm not sure exactly why they can't on their side
- "brand" should be disjunctive only IMO
Hey @bobylito, have you had time to look at this one?
Not yet.
Following up on some of our offline conversations with @kokliKo:
Ok so if we dumb down what the requirements are, this would give us:
- make wildcard /
*
usable on conjunctive facets withfacets: '*'
(no need for an array here) - other facet won't benefit from the wildcard
- any facet definition that are defined as another kind of facet will be considered not conjunctive
Some cons about that are that:
- checks that test if a conjunctive facet is defined will be virtually disabled making mistakes more likely to happen (like refining of a typoed facet name)
- API is not symmetrical
- all the possible facets will be downloaded
In this conditions that seems to be doable but it is still not trivial. I don't think I'll have the bandwidth to handle it right away but I'll make sure to add it to the next release that contains new features (after the release of react-instantsearch)
This feature is low priority. Will close for now. Let me know if it's a blocker.
@bobylito Any chance to make this possible coz I also came across the same requirement 2 weeks back and was trying to find a way how to do this. The reason why we need to make it wildcard is that we have 2 websites which share same codebase and these websites is using different facets. So we need to make it somehow dynamic instead of enumerating all the facets for each website
Thanks @nelsieborja for your feedback. As I said, it could be possible but with some limitations. I will sync up with the JS team at Algolia to see how can we manage to prioritize this feature.
@bobylito Thanks for considering this. Was able to find a quick and possible adjustment in the code to achieve the said requirement. So you can add this feature in your own time ;)
Hi, I'm trying to retrieve all the facets of the result set by querying with
{
facets: ['*'],
...
}
I'm not even setting a value for disjunctiveFacets
and still getting a result with an empty array in the facets
key. Is this supported?
According to this: https://www.algolia.com/doc/guides/searching/faceting/?language=javascript#retrieving-facets it should work.
Hey @mapolonio, could you open a new issue with a codepen for reproduction please?
@Haroenv here it is https://github.com/algolia/algoliasearch-helper-js/issues/607