-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.html
196 lines (174 loc) · 5.98 KB
/
index.html
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<link rel="manifest" href="./manifest.webmanifest" />
<link rel="shortcut icon" href="./favicon.png" />
<link rel="stylesheet" href="./src/app.scss" />
<title>Ecommerce Store with Typesense</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-116415641-9"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-116415641-9');
</script>
</head>
<body>
<div class="container-fluid px-md-5 pt-4">
<div class="row d-flex align-items-center">
<div class="col-md">
<h1 class="display-4">Ecommerce Store with Typesense</h1>
</div>
<div class="col-md-2 d-none d-md-block">
<div id="searchbox"></div>
</div>
</div>
<div class="lead mt-2">
Besides search experiences, Typesense can also be used to build
<strong class="marker-highlight">blazing fast</strong>,
<strong class="marker-highlight">browsing experiences</strong> like
product listing pages in an ecommerce store.
</div>
<ul class="mt-1">
<li>
Product data to render the grid is fetched by the front-end from a
<strong>Geo-Distributed Typesense Cloud cluster</strong> with nodes in
Oregon, Frankfurt and Mumbai.
</li>
<li>
Product API Requests are routed to the node that is closest to the
user's location, like a CDN. Since data is geographically distributed,
this reduces latency even more for your users, as they browse
products.
</li>
<li>
We use Typesense's Vector Search feature (available as of 0.24.0) to
power the "Find Similar" link under each product. Click on it to learn
more.
</li>
<li>
See
<a
href="https://github.com/typesense/showcase-ecommerce-store"
target="_blank"
>Source Code</a
>.
</li>
</ul>
<div class="row mt-4">
<div class="col-md-3 pr-md-5">
<h5>Browse by Categories</h5>
<div class="mt-3" id="categories-hierarchical-menu"></div>
<h5 class="mt-5">Filter by Brands</h5>
<div id="brand-list" class="mt-3"></div>
<div class="mt-2"> </div>
<div class="mt-5" id="toggle-refinement"></div>
<div class="mt-1"> </div>
<h5 class="mt-5">Filter by Price</h5>
<div id="price-range-slider"></div>
<div class="mt-1"> </div>
<h5 class="mt-5">Filter by Rating</h5>
<div id="rating-menu" class="mt-3"></div>
<div class="mt-1"> </div>
<div id="clear-refinements" class="mt-5"></div>
</div>
<div class="col-md">
<div class="row mt-5 mt-md-0">
<div class="col-md">
<div class="row">
<div class="col-md-4"></div>
<div
class="col-md-8 d-flex justify-content-end align-items-center"
>
<div id="stats"></div>
<div id="hits-per-page"></div>
<div id="sort-by"></div>
</div>
</div>
</div>
</div>
<div class="row mt-1">
<div class="col-sm">
<div id="hits"></div>
</div>
</div>
<div class="row">
<div class="col-sm">
<div id="pagination"></div>
</div>
</div>
</div>
</div>
</div>
<div id="similar-products-modal" class="modal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title">Similar Products</h2>
<button
type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"
></button>
</div>
<div class="modal-body">
<h5>How this works:</h5>
<ul>
<li>
We use Sentence-BERT
<a
href="https://github.com/typesense/showcase-ecommerce-store/blob/master/scripts/vector-generation/main.py"
target="_blank"
>to generate vectors</a
>
for each product
</li>
<li>
Then we
<a
href="https://github.com/typesense/showcase-ecommerce-store/blob/master/scripts/populateTypesenseIndex.js"
target="_blank"
>index them</a
>
using Typesense's vector search feature (available as of 0.24.0)
</li>
<li>
When "Find similar" is clicked, we do a
<a
href="https://github.com/typesense/showcase-ecommerce-store/blob/2837e880b7a426a4008d6819b5369b76c4c178fb/src/app.js#L295-L302"
target="_blank"
>nearest neighbor search</a
>
to show similar products.
</li>
</ul>
<div class="similar-products d-flex overflow-auto"></div>
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-secondary"
data-bs-dismiss="modal"
>
Close
</button>
</div>
</div>
</div>
</div>
<script type="module" src="./src/app.js"></script>
</body>
</html>