-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
41 lines (35 loc) · 853 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
var search = instantsearch({
// Replace with your own values
appId: '4XE5Z25BS5',
apiKey: '62506859dce690b1cc5aadd634e8999e', // search only API key, no ADMIN key
indexName: 'idx_mt101',
urlSync: true,
searchParameters: {
hitsPerPage: 100
}
});
search.addWidget(
instantsearch.widgets.searchBox({
container: '#search-input'
})
);
search.addWidget(
instantsearch.widgets.hits({
container: '#hits',
templates: {
item: document.getElementById('hit-template').innerHTML,
empty: "We didn't find any results for the search <em>\"{{query}}\"</em>"
},
cssClasses: {
root: 'row'
,item: 'col-lg-3 col-md-4 col-sm-6'
}
})
);
search.addWidget(
instantsearch.widgets.pagination({
container: '#pagination'
})
);
// Add this after all the search.addWidget() calls
search.start();