-
Notifications
You must be signed in to change notification settings - Fork 498
/
app.js
45 lines (38 loc) · 841 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
require('./style.css');
var instantsearch = require('../');
var search = new instantsearch.InstantSearch(
'latency',
'6be0576ff61c053d5f9a3225e2a90f76',
'instant_search'
);
search.addWidget(
instantsearch.widgets.searchBox({
container: '#search-box',
placeholder: 'Search for products',
cssClass: 'form-control'
})
);
search.addWidget(
instantsearch.widgets.hits({
container: '#hits',
templates: {
empty: require('./templates/no-results.html'),
hit: require('./templates/hit.html')
},
hitsPerPage: 6
})
);
search.addWidget(
instantsearch.widgets.pagination({
container: '#pagination',
cssClass: 'pagination',
maxPages: 20
})
);
search.addWidget(
instantsearch.widgets.multipleChoiceList({
container: '#brands',
facetName: 'brand'
})
);
search.start();