question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

First predefined facet-filter will be overwritten by ais-refinement-list facets

See original GitHub issue

Bug 🐞

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:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
th1nkgr33ncommented, Dec 14, 2021

Oh no… sorry, I miss understood the docs. Thanks for making this clear! I switched it and it worked. Thanks!

0reactions
Haroenvcommented, Apr 7, 2022

Yes, sorry, that’s meant to say “filters”, not facets. Thanks for the clarification @zakjholt

Read more comments on GitHub >

github_iconTop Results From Across the Web

ais-refinement-list | Vue InstantSearch - Algolia
With this widget, the user can filter the dataset based on facets. The widget only displays the most relevant facet values for the...
Read more >
Algolia vue auto select facets - Stack Overflow
I tried to use the <ais-configure/> component to filter my results before showing them on the page, as I am working with different...
Read more >
Faceted Search Enhancements in APEX 20.2 - Oracle Blogs
Faceted Search was introduced in APEX 19.2 allowing users to filter information easily and intuitively by selecting the options in each ...
Read more >
Faceted Navigation: Definition, Examples & SEO Best Practices
When the user clicks to apply the filters, a new page loads. The first two options have a similar UX but a different...
Read more >
The Definitive Guide to the Difference Between Filters and ...
Filters and facets are different. Both are essential tools for search but many people use the terms interchangeably. A quick guide on how ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found