First predefined facet-filter will be overwritten by ais-refinement-list facets
See original GitHub issueBug 🐞
What is the current behavior?
If setup a pre-defined facetFilter inside ais-configure like
<ais-configure
:facet-filters.camel="[
[
'brand:Amazon',
'brand:Google',
],
]"
/>
the first filter will be overwritten if I click on a facet (e.g. Streaming Media Player). And more than 6 of the expected items are returns. Doesn’t matter if I setup the refinement List with operator=“and” or operator=“or”. You could also inspect the payload inside the call to algolia and you will see that the facetFilters-Array will be manipulated in loosing the first element.
We fixed this issue by adding a blank placeholder for each facet we want to refine. In example of the sandbox I added one blank entry to array in which the refinementList could add his stuff.
<ais-configure
:facet-filters.camel="[
'', // first filter will be overwritten from the refinementlist?? WHY?
[
'brand:Amazon',
'brand:Google',
],
]"
/>
Then the results will be really just 6.
Make a sandbox with the current behavior
https://codesandbox.io/s/vigorous-hugle-3dhtp?file=/src/App.vue
What is the expected behavior?
The search results should only show 6 results and not more!
Does this happen only in specific situations?
Not really… see Sandbox. I just added the facet-filters and switch the refinementlist attribute to categories.
What is the proposed solution?
The facetFilters from the refinementList should be added and not overwrite the pre defined facetFilters from ais-configure.
What is the version you are using?
Latest 4.2.0 (See sandbox package.json)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Oh no… sorry, I miss understood the docs. Thanks for making this clear! I switched it and it worked. Thanks!
Yes, sorry, that’s meant to say “filters”, not facets. Thanks for the clarification @zakjholt