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.

Filtering some facet values

See original GitHub issue

While displaying my facets, I would like to filter out some of them without removing them from my index. I was thinking about something like:

search.addWidget(
  instantsearch.widgets.refinementList({
    container: '#brands',
    attributeName: 'brand',
    transformData: function(data) {
      if (data.value === 'uggly') return false;
      // [...]
      return data;
    }
  })
);

or

search.addWidget(
  instantsearch.widgets.refinementList({
    container: '#brands',
    attributeName: 'brand',
    filterFacets: function(facets) {
      return filter(facets, function (f) { return f.value !== 'uggly' });
    }
  })
);

If well documented, I don’t think it will conflict with the limit attribute.

What do you think?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
timkeltycommented, Aug 9, 2017

@Haroenv My use-case was a bit more involved (more than just filtering, but similar requirements), so I made an issue: https://github.com/algolia/instantsearch.js/issues/2283

0reactions
Haroenvcommented, Aug 9, 2017

Hey @timkelty, this is a very old issue, could you make a new one describing your issue? You can use every template as a function, and there leave out any values you need

Read more comments on GitHub >

github_iconTop Results From Across the Web

Filters and facet filters - Algolia
For facet filtering, all you need to do is list the attributes using brackets. Without brackets, the entire list is interpreted as combining ......
Read more >
Faceted Filtering: The Ultimate Guide For eCommerce Sites
Faceted search allows you to create filters based on keywords. You can provide shoppers with multiple filters, which makes the experience similar to...
Read more >
Faceting and filtering - Bloomreach Documentation
The fq parameter filters on facets. Your product feed must include any filtering elements that you want applied to your search results. Confirm...
Read more >
The Definitive Guide to the Difference Between Filters and ...
Unlike facets, filters never change between searches. They will always be the same and don't adjust to reflect the search results, ...
Read more >
What is Faceted Search and Navigation? 14 Tips & 24 Examples
There are several ways of displaying facet filters. Options include links, sliders, checkboxes, dropdowns, and input fields. · Choose the way you ...
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