Skip to content

Commit 7ad629d

Browse files
docs(search-quality): add explanation for the Search Quality tab
1 parent 604ba5b commit 7ad629d

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

src/components/Collections/SearchQuality/SearchQuality.jsx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,24 @@ import { bigIntJSON } from '../../../common/bigIntJSON';
1010
import EditorCommon from '../../EditorCommon';
1111
import _ from 'lodash';
1212

13+
const explainLog = `Example Output: [18/10/2024, 01:51:38] Point ID 1(1/100) precision@10: 0.8 (search time exact: 30ms, regular: 5ms)
14+
15+
Explanation:
16+
This output compares the performance of an exact search (full kNN) versus an approximate search using ANN (Approximate Nearest Neighbor).
17+
18+
- precision@10: 0.8: Out of the top 10 results returned by the exact search, 8 were also found in the ANN search.
19+
- Search Time: The exact search took 30ms, whereas the ANN search was much faster, taking only 5ms, but with a small loss in accuracy.
20+
21+
Tuning the HNSW Algorithm (Advanced mode):
22+
- "hnsw_ef" parameter: Controls how many neighbors to consider during a search. Increasing "hnsw_ef" improves precision but slows down the search.
23+
24+
Practical Use:
25+
- The ANN search (with HNSW) is significantly faster (5ms compared to 30ms) but slightly less accurate (precision@10: 0.8). You can adjust parameters like "hnsw_ef" in advanced mode to find the right balance between speed and accuracy.
26+
27+
Additional Tuning Parameters (need to be set during collection configuration):
28+
1. "m" Parameter : Defines the number of edges per node in the graph. A higher "m" value improves accuracy but uses more memory.
29+
2. "ef_construct" Parameter: Sets the number of neighbors to consider during index creation. A higher value increases precision but requires more time during indexing.`;
30+
1331
const SearchQuality = ({ collectionName }) => {
1432
const { enqueueSnackbar, closeSnackbar } = useSnackbar();
1533
const { client } = useClient();
@@ -25,7 +43,7 @@ const SearchQuality = ({ collectionName }) => {
2543
};
2644

2745
const clearLogs = () => {
28-
setLog('');
46+
setLog(' ');
2947
};
3048

3149
useEffect(() => {
@@ -62,7 +80,7 @@ const SearchQuality = ({ collectionName }) => {
6280

6381
<Card varian="dual" sx={{ mt: 5 }}>
6482
<CardHeader
65-
title={'Report'}
83+
title={log ? 'Report' : 'What is Search Quality?'}
6684
variant="heading"
6785
sx={{
6886
flexGrow: 1,
@@ -71,8 +89,10 @@ const SearchQuality = ({ collectionName }) => {
7189
/>
7290
<Box sx={{ pt: 2, pb: 1, pr: 1 }}>
7391
<EditorCommon
92+
language={'custom-language'}
7493
theme={'custom-language-theme'}
75-
value={log}
94+
value={log || explainLog}
95+
customHeight={'calc(100vh - 660px)'}
7696
options={{
7797
scrollBeyondLastLine: false,
7898
fontSize: 12,

0 commit comments

Comments
 (0)