File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ landing_getting_started_1 : |-
2+ // in app.js
3+ const search = instantsearch({
4+ indexName: 'movies',
5+ searchClient: instantMeiliSearch(
6+ 'http://localhost:7700',
7+ 'searchKey'
8+ ),
9+ })
10+
11+ search.addWidgets([
12+ instantsearch.widgets.searchBox({
13+ container: '#searchbox',
14+ }),
15+ instantsearch.widgets.hits({
16+ container: '#hits',
17+ templates: {
18+ item: `
19+ <div>
20+ <div class="hit-name">
21+ {{#helpers.highlight}}{ "attribute": "title" }{{/helpers.highlight}}
22+ </div>
23+ </div>
24+ `,
25+ },
26+ }),
27+ ])
28+ search.start()
29+
30+ // in index.html
31+ <!DOCTYPE html>
32+ <html lang="en">
33+ <head>
34+ <meta charset="utf-8" />
35+ </head>
36+
37+ <body>
38+ <div>
39+ <div id="searchbox"></div>
40+ <div id="hits"></div>
41+ </div>
42+
43+ <script src="https://cdn.jsdelivr.net/npm/@meilisearch/instant-meilisearch/dist/instant-meilisearch.umd.min.js"></script>
44+ <script src="https://cdn.jsdelivr.net/npm/instantsearch.js@4"></script>
45+ <script src="./app.js"></script>
46+ </body>
47+ </html>
You can’t perform that action at this time.
0 commit comments