JMK*_*ley 0 algolia instantsearch.js
目前正在使用Algolia通过其instantSearch.js提供的无限搜索方法.
发生以下情况:
从它的外观来看 - 它将新细化的结果附加到已经存在的结果中.我想让它反感结果,不确定这是否是即时搜索本身的错误?
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'
}
})
);
Run Code Online (Sandbox Code Playgroud)
而无限的搜索代码:
search.addWidget(
instantsearch.widgets.infiniteHits({
container: '#infinite-hits-container',
templates: {
empty: 'No results',
item: hitTemplate
},
hitsPerPage: 3
})
);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
215 次 |
| 最近记录: |