-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
107 lines (99 loc) · 5.28 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HN Comments Semantic Search</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="./src/scss/index.scss">
<script type="module" src="./src/js/index.js"></script>
<link rel="shortcut icon" href="./favicon.png">
<meta name="description"
content="HN Comments Semantic Search with Typesense">
<meta name="keywords"
content="search, semantic search, hybrid search, vector search, HN comments, search engine, typesense"/>
</head>
<body>
<div class="container py-2">
<div class="bg-light">
<div class="bg-primary">
</div>
<div class="py-3 px-4">
<div class="row">
<div class="col-sm">
<h1 class="h5 mb-3">Hacker News Comments - Hybrid Search</h1>
<div>Keyword Search + Semantic Search + Filtering + Faceting</div>
<div>Powered by <a href="https://typesense.org" target="_blank">Typesense</a></div>
<div class="mt-3">
<ul>
<li> This is a collection of 324K HN comments during the month of Oct 2022.</li>
<li>The data is indexed in Typesense using the new <a href="https://typesense.org/docs/0.25.0/api/vector-search.html#using-built-in-models" target="_blank">built-in embedding generation</a> (using S-BERT).</li>
<li>When a search query is typed in "Semantic Search" mode, Typesense automatically generates embeddings for the query using S-BERT, then does a nearest-neighbor search and returns the closest matches.</li>
<li>When a search query is typed in "Hybrid" mode, Typesense does both a regular keyword search and semantic search and combines the results using Rank Fusion.</li>
</ul>
<a href="https://github.com/typesense/showcase-hn-comments-semantic-search"
target="_blank">View Source</a>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-sm">
<div class="row">
<div class="col-sm-10 pe-sm-1">
<div id="searchbox"></div>
</div>
<div class="col-sm-2 ps-sm-1 mt-2 mt-sm-0">
<select class="form-select" id="search-type-select"
aria-label="Search Type">
<option value="semantic" selected>Semantic Search</option>
<option value="keyword">Keyword Search</option>
<option value="hybrid">Hybrid Search</option>
</select>
</div>
</div>
<div class="row mt-1">
<div class="col-sm">
Try:
<span id="example-search-terms">
<a role="button" class="clickable-search-term">cinema</a>,
<a role="button" class="clickable-search-term">beethoven</a>,
<a role="button" class="clickable-search-term">napster</a>,
<a role="button" class="clickable-search-term">network congestion</a>,
<a role="button" class="clickable-search-term">high growth</a>,
<a role="button" class="clickable-search-term">ssl cipher</a>
</span>
</div>
<div class="col-sm-4">
<div id="stats"></div>
</div>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-sm-2">
<nav class="navbar navbar-expand-md navbar-light p-0 pb-3">
<button class="navbar-toggler text-primary border-light-2" type="button"
data-bs-toggle="collapse"
data-bs-target="#filters-section"
aria-controls="filters-section" aria-expanded="false" aria-label="Toggle filters">
<span class="navbar-toggler-icon"></span><span class="ml-2"
style="font-size: 13px;">Refine</span>
</button>
<div class="collapse navbar-collapse d-md-block mt-3 mt-md-0" id="filters-section">
<div class="row mb-2">
<div class="col-md">
<div id="users-refinement-list"></div>
</div>
</div>
</div>
</nav>
</div>
<div class="col-sm-10">
<div id="hits"></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>