I'm using Algolia Instant Search for a project but I have a small issue to send a filtered request. Here an example of what I want to do, using one of the instant search example page : https://community.algolia.com/instantsearch.js/examples/e-commerce/
On this page, there are all the filters in the aside and the products in the main content block. In the products description, I would like to had links on keywords which operate as a filter in the aside. For example, for the Chopping board "LEGITIM" (first product on the left), in the description, there is the keyword "white". I would like, if this keyword was a link, that when click on it, it operates as clicking on the white value in the color picker aside.
I tried to use JQuery trigger function and it works well, but only for values which are actually displayed in the filters. Following my example it would be okay with white value (because this one is available in the color picker) but it won't works with yellow value.
Does someone has an idea to solve this thing ?
Best,
What you could do is directly use the algoliasearch-helper like this:
// bind the click event on the color name, then
$('.hits .color').click(function(ev) {
var color = $(this).data('color'); // given you store the color somehwere in a data-color attribute
search.helper.toggleRefinement('color', color); // search is your instantsearch instance
search.helper.search();
});
This is a very good usecase, we will write a full guide on it. Let me know if that answer is already a good start for your issue.