Reputation: 658
Currently using the infinite search method that Algolia supplies through their instantSearch.js.
The following scenario is happening:
By the looks of it - it's appending the results of the new refinement to the results that are already there. I'm looking to make it resent the results, not sure if this is a bug with instant search itself?
search.addWidget(
instantsearch.widgets.numericRefinementList({
container: '#price',
attributeName: 'salePrice',
options: [
{name: 'All'},
{end: 20, name: 'less than 20'},
{end: 50, name: 'less than 50'},
{start: 50, end: 100, name: 'between 50 and 100'},
{start: 100, end: 300, name: 'Expensive'},
{start: 300, name: 'Very Expensive'}
],
templates: {
header: 'Price'
}
})
);
And the infinite search code:
search.addWidget(
instantsearch.widgets.infiniteHits({
container: '#infinite-hits-container',
templates: {
empty: 'No results',
item: hitTemplate
},
hitsPerPage: 3
})
);
Upvotes: 0
Views: 523