-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathatom.xml
More file actions
420 lines (420 loc) · 38 KB
/
Copy pathatom.xml
File metadata and controls
420 lines (420 loc) · 38 KB
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<author>
<name>magicliang</name>
</author>
<generator uri="https://hexo.io/">Hexo</generator>
<id>https://magicliang.github.io/</id>
<link href="https://magicliang.github.io/" rel="alternate"/>
<link href="https://magicliang.github.io/atom.xml" rel="self"/>
<rights>All rights reserved 2026, magicliang</rights>
<subtitle>一切都是守株待兔,如切如磋,如琢如磨。I am just joking.</subtitle>
<title>守株阁</title>
<updated>2026-09-17T03:55:37.838Z</updated>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="人文" scheme="https://magicliang.github.io/categories/%E4%BA%BA%E6%96%87/"/>
<category term="历史" scheme="https://magicliang.github.io/tags/%E5%8E%86%E5%8F%B2/"/>
<category term="比较政治" scheme="https://magicliang.github.io/tags/%E6%AF%94%E8%BE%83%E6%94%BF%E6%B2%BB/"/>
<category term="政治制度" scheme="https://magicliang.github.io/tags/%E6%94%BF%E6%B2%BB%E5%88%B6%E5%BA%A6/"/>
<category term="宪政" scheme="https://magicliang.github.io/tags/%E5%AE%AA%E6%94%BF/"/>
<category term="权力分立" scheme="https://magicliang.github.io/tags/%E6%9D%83%E5%8A%9B%E5%88%86%E7%AB%8B/"/>
<id>https://magicliang.github.io/2026/09/16/%E6%80%BB%E7%BB%9F%E5%88%B6%E5%86%85%E9%98%81%E5%88%B6%E4%B8%8E%E5%8D%8A%E6%80%BB%E7%BB%9F%E5%88%B6/</id>
<link href="https://magicliang.github.io/2026/09/16/%E6%80%BB%E7%BB%9F%E5%88%B6%E5%86%85%E9%98%81%E5%88%B6%E4%B8%8E%E5%8D%8A%E6%80%BB%E7%BB%9F%E5%88%B6/"/>
<published>2026-09-16T04:00:00.000Z</published>
<summary>从英国责任内阁、美国分权宪法到法国双首长制,比较欧美主要国家、日韩及港澳台地区的制度,解释政府产生、信任责任、司法独立与权力制衡。</summary>
<title>总统制、内阁制与半总统制:历史沿革、权力分立与各国实践</title>
<updated>2026-09-17T03:55:37.838Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="基础设施" scheme="https://magicliang.github.io/categories/%E5%9F%BA%E7%A1%80%E8%AE%BE%E6%96%BD/"/>
<category term="操作系统" scheme="https://magicliang.github.io/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/"/>
<category term="x86" scheme="https://magicliang.github.io/tags/x86/"/>
<category term="用户态" scheme="https://magicliang.github.io/tags/%E7%94%A8%E6%88%B7%E6%80%81/"/>
<id>https://magicliang.github.io/2026/09/08/%E4%BB%8E%E9%9B%B6%E7%BC%96%E5%86%99%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F-16-%E8%BF%9B%E5%85%A5%E7%94%A8%E6%88%B7%E6%80%81/</id>
<link href="https://magicliang.github.io/2026/09/08/%E4%BB%8E%E9%9B%B6%E7%BC%96%E5%86%99%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F-16-%E8%BF%9B%E5%85%A5%E7%94%A8%E6%88%B7%E6%80%81/"/>
<published>2026-09-08T05:00:00.000Z</published>
<summary>
<![CDATA[<p>第 15 篇已经能让任务等待、唤醒和接受时钟抢占,但所有任务仍在 ring 0,共享内核页表与执行权限。<br>
一个错误指针可以改写内核数据,一条 CLI 可以阻止普通中断进入。<br>
独立任务栈与轮转调度都不能代替访问权限。</p>
<p>本篇为两个用户任务建立独立地址空间,经 IRETD 进入 ring 3,让它们在相同虚拟地址递增各自的计数。<br>
三轮实验分别让其中一个任务写内核数据、执行 CLI、执行 OUT,要求错误任务停止,而另一个继续增长。<br>
用户代码仍是内嵌的手写机器指令;本篇没有 ELF 加载器、系统调用或用户自行退出接口,有限实验由内核监督收尾。</p>]]>
</summary>
<title>从零编写操作系统 16 - 进入用户态:让错误程序无法直接改内核</title>
<updated>2026-09-17T03:55:37.837Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="基础设施" scheme="https://magicliang.github.io/categories/%E5%9F%BA%E7%A1%80%E8%AE%BE%E6%96%BD/"/>
<category term="操作系统" scheme="https://magicliang.github.io/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/"/>
<category term="x86" scheme="https://magicliang.github.io/tags/x86/"/>
<category term="任务调度" scheme="https://magicliang.github.io/tags/%E4%BB%BB%E5%8A%A1%E8%B0%83%E5%BA%A6/"/>
<id>https://magicliang.github.io/2026/09/08/%E4%BB%8E%E9%9B%B6%E7%BC%96%E5%86%99%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F-15-%E7%AD%89%E5%BE%85%E4%B8%8E%E5%94%A4%E9%86%92/</id>
<link href="https://magicliang.github.io/2026/09/08/%E4%BB%8E%E9%9B%B6%E7%BC%96%E5%86%99%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F-15-%E7%AD%89%E5%BE%85%E4%B8%8E%E5%94%A4%E9%86%92/"/>
<published>2026-09-08T04:00:00.000Z</published>
<summary>
<![CDATA[<p>第 14 篇已经能用时钟轮转两个计算任务,但没有输入时,键盘消费者没有可处理的数据。<br>
反复取得时间片再检查空队列,只会重复得到同一个结果。<br>
本篇增加 BLOCKED 状态:消费者登记等待条件后退出就绪集合,生产者改变条件时再把它变回 RUNNABLE。</p>
<p>关键问题发生在检查条件与登记等待之间。<br>
若输入恰好在这段间隙到达,生产者可能发现没有等待者,随后消费者却仍按旧结果进入阻塞,形成“条件已经满足,任务仍然睡着”的丢失唤醒。<br>
实验用真实 PIT 中断分别制造错误顺序和受保护顺序,再把同一套等待接口接到定时睡眠、idle 与持续运行的键盘任务。</p>]]>
</summary>
<title>从零编写操作系统 15 - 等待与唤醒:任务为什么不能一直轮询</title>
<updated>2026-09-17T03:55:37.837Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="基础设施" scheme="https://magicliang.github.io/categories/%E5%9F%BA%E7%A1%80%E8%AE%BE%E6%96%BD/"/>
<category term="操作系统" scheme="https://magicliang.github.io/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/"/>
<category term="x86" scheme="https://magicliang.github.io/tags/x86/"/>
<category term="任务调度" scheme="https://magicliang.github.io/tags/%E4%BB%BB%E5%8A%A1%E8%B0%83%E5%BA%A6/"/>
<id>https://magicliang.github.io/2026/09/08/%E4%BB%8E%E9%9B%B6%E7%BC%96%E5%86%99%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F-14-%E6%8A%A2%E5%8D%A0%E8%B0%83%E5%BA%A6/</id>
<link href="https://magicliang.github.io/2026/09/08/%E4%BB%8E%E9%9B%B6%E7%BC%96%E5%86%99%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F-14-%E6%8A%A2%E5%8D%A0%E8%B0%83%E5%BA%A6/"/>
<published>2026-09-08T03:00:00.000Z</published>
<summary>
<![CDATA[<p>第 13 篇能够保存两条调用链,但 A 一旦进入不含 <code>yield</code> 的无限循环,已经就绪的 B 就无法运行。<br>
本篇把第 08 篇的 PIT 时钟接入同一个调度器,让两个没有主动让出点的计算任务都取得进展。<br>
时间片采用最小规则:每次时钟中断提出一次轮转请求,允许调度时在中断处理出口切换。</p>
<p>切换函数仍然只保存四个被调用者保存寄存器。<br>
被时钟打断的完整寄存器与 EFLAGS 则留在原任务的中断栈帧里,等该任务恢复以后由 IRETD 还原。<br>
实验另外检查允许中断但禁止抢占、真正关闭中断、嵌套恢复,以及屏蔽 IRQ0 后另一个任务停滞的区别。</p>]]>
</summary>
<title>从零编写操作系统 14 - 抢占调度:时间片结束后怎样换一个任务</title>
<updated>2026-09-17T03:55:37.836Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="基础设施" scheme="https://magicliang.github.io/categories/%E5%9F%BA%E7%A1%80%E8%AE%BE%E6%96%BD/"/>
<category term="操作系统" scheme="https://magicliang.github.io/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/"/>
<category term="x86" scheme="https://magicliang.github.io/tags/x86/"/>
<category term="任务调度" scheme="https://magicliang.github.io/tags/%E4%BB%BB%E5%8A%A1%E8%B0%83%E5%BA%A6/"/>
<id>https://magicliang.github.io/2026/09/08/%E4%BB%8E%E9%9B%B6%E7%BC%96%E5%86%99%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F-13-%E4%BF%9D%E5%AD%98%E4%B8%8E%E6%81%A2%E5%A4%8D%E6%89%A7%E8%A1%8C%E7%8E%B0%E5%9C%BA/</id>
<link href="https://magicliang.github.io/2026/09/08/%E4%BB%8E%E9%9B%B6%E7%BC%96%E5%86%99%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F-13-%E4%BF%9D%E5%AD%98%E4%B8%8E%E6%81%A2%E5%A4%8D%E6%89%A7%E8%A1%8C%E7%8E%B0%E5%9C%BA/"/>
<published>2026-09-08T02:00:00.000Z</published>
<summary>
<![CDATA[<p>第 12 篇已经能按字节分配内核对象,但执行路径仍沿着同一份调用栈推进。<br>
普通函数 A 调用 B 后,只有 B 返回,A 才能继续;如果 B 一直计算,其他工作就无法通过这条调用链取得 CPU。<br>
本篇为两个内核任务各分配一张栈页,让任务在 <code>task_yield()</code> 处暂停,并在以后从同一次调用之后继续。</p>
<p>正常实验要求 A、B 各完成 128 轮计数,跨切换保留局部数组、被调用者保存寄存器和各自的中断允许状态,退出后归还两张栈页。<br>
另一个镜像让 A 永远不调用 <code>yield</code>,检查 B 虽然已经就绪,计数仍然停在零。<br>
这套实现只在单 CPU、ring 0、普通函数调用边界切换,没有时钟抢占,也没有独立用户地址空间。</p>]]>
</summary>
<title>从零编写操作系统 13 - 保存与恢复执行现场:先实现协作式任务</title>
<updated>2026-09-17T03:55:37.835Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-E05-%E7%A3%81%E7%9B%98-ANN-%E4%B8%8E%E5%BC%95%E6%93%8E%E5%B7%A5%E7%A8%8B%E5%AF%B9%E7%85%A7/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-E05-%E7%A3%81%E7%9B%98-ANN-%E4%B8%8E%E5%BC%95%E6%93%8E%E5%B7%A5%E7%A8%8B%E5%AF%B9%E7%85%A7/"/>
<published>2026-09-07T13:00:00.000Z</published>
<summary>
<![CDATA[<p>主线第 19 篇把向量全部加载到内存中的 HNSW 图里。100 篇文档、512 维 float32,总共 200 KB——任何机器都装得下。但如果语料从 100 篇增长到 100 万篇,200 KB 变成 2 GB;到 1 亿篇,就是 200 GB。常规服务器的内存通常在 64-256 GB 之间,向量数据已经不够放了。</p>
<p>这是向量检索的内存墙问题。解法有三个方向:量化压缩(第 22 篇)、分片分散(第 26 篇)、把向量放到磁盘上。本篇讨论第三个方向——磁盘 ANN,以及在什么规模下应该考虑从 Lucene 切换到专用向量引擎。</p>]]>
</summary>
<title>从零构建现代搜索引擎(E05):磁盘 ANN 与引擎工程对照</title>
<updated>2026-09-17T03:55:37.835Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-E04-%E6%9C%89%E7%95%8C%E5%A4%9A%E6%AD%A5%E6%90%9C%E7%B4%A2%E4%B8%8E%E5%BC%95%E7%94%A8%E7%AD%94%E6%A1%88/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-E04-%E6%9C%89%E7%95%8C%E5%A4%9A%E6%AD%A5%E6%90%9C%E7%B4%A2%E4%B8%8E%E5%BC%95%E7%94%A8%E7%AD%94%E6%A1%88/"/>
<published>2026-09-07T12:00:00.000Z</published>
<summary>
<![CDATA[<p>用户搜"Java 虚拟线程和平台线程的性能差异",搜索引擎返回 10 篇文档链接。用户点开第一篇,发现只讲了虚拟线程的概念;点开第二篇,有性能数据但对比的是 Go 协程;翻到第五篇才找到需要的对比数据。</p>
<p>这个场景暴露了传统检索的局限:搜索引擎只负责找文档,把"从多篇文档中提取、整合、回答问题"的工作留给了用户。RAG(Retrieval-Augmented Generation)把这最后一步自动化——检索文档后用语言模型生成带引用的答案。</p>
<p>但 RAG 不是无限制的。模型可能幻觉,检索可能失败,生成可能超时。有界多步搜索在 RAG 之上加入资源预算:限定最大检索轮次、总耗时和 token 消耗,在可控成本内给出最佳答案。</p>]]>
</summary>
<title>从零构建现代搜索引擎(E04):有界多步搜索与引用答案</title>
<updated>2026-09-17T03:55:37.835Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-E03-%E5%A4%9A%E6%A8%A1%E6%80%81%E6%96%87%E6%A1%A3%E6%90%9C%E7%B4%A2/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-E03-%E5%A4%9A%E6%A8%A1%E6%80%81%E6%96%87%E6%A1%A3%E6%90%9C%E7%B4%A2/"/>
<published>2026-09-07T11:00:00.000Z</published>
<summary>
<![CDATA[<p>技术文档的信息不全在文字里。一份 API 文档中的架构图、一篇论文里的实验结果表格、一页 PDF 中的流程图——这些视觉元素承载的信息量常常超过周围的文字描述。传统的文本检索管线对这些内容视而不见:OCR 提取的文字丢失版式信息,表格变成无结构的字符串,流程图直接被忽略。</p>
<p>多模态 embedding 模型提供了另一条路径:直接把页面图像编码为向量,跳过 OCR,保留视觉结构。</p>]]>
</summary>
<title>从零构建现代搜索引擎(E03):多模态文档搜索</title>
<updated>2026-09-17T03:55:37.835Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-E02-%E5%A4%9A%E5%90%91%E9%87%8F%E4%B8%8E-Late-Interaction/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-E02-%E5%A4%9A%E5%90%91%E9%87%8F%E4%B8%8E-Late-Interaction/"/>
<published>2026-09-07T10:00:00.000Z</published>
<summary>
<![CDATA[<p>主线第 18 篇把整篇文档压缩成一个 512 维向量。这个"池化"操作不可避免地丢失信息:一篇同时讨论"线程池配置"和"垃圾回收调优"的长文档,其单向量是两个主题的模糊平均——搜任何一个主题都不会得到高分,搜两个主题的交集反而可能命中。</p>
<p>ColBERT(Khattab & Zaharia, 2020)提出了不同的方案:不池化,保留每个 token 的独立向量,在检索时做 token 级的细粒度匹配。</p>]]>
</summary>
<title>从零构建现代搜索引擎(E02):多向量与 Late Interaction</title>
<updated>2026-09-17T03:55:37.835Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-E01-%E5%AD%A6%E4%B9%A0%E7%A8%80%E7%96%8F%E6%A3%80%E7%B4%A2/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-E01-%E5%AD%A6%E4%B9%A0%E7%A8%80%E7%96%8F%E6%A3%80%E7%B4%A2/"/>
<published>2026-09-07T09:00:00.000Z</published>
<summary>
<![CDATA[<p>BM25 靠精确词匹配召回文档。用户搜"怎样并行处理",文档里写的是"多线程编程"——BM25 一条也召不回来。dense retrieval 用向量弥补词汇鸿沟,但丢掉了精确匹配的优势:搜错误码 <code>NullPointerException</code>,dense 模型可能把它和所有异常类文档混在一起。</p>
<p>学习稀疏检索(learned sparse retrieval)试图兼得两头:保留倒排索引的精确匹配和可解释性,同时用模型扩展词汇覆盖范围。</p>]]>
</summary>
<title>从零构建现代搜索引擎(E01):学习稀疏检索</title>
<updated>2026-09-17T03:55:37.835Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-30-%E4%BB%8E%E7%A9%BA%E7%9B%AE%E5%BD%95%E5%AE%8C%E6%88%90%E6%9C%80%E7%BB%88%E6%BC%94%E7%A4%BA/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-30-%E4%BB%8E%E7%A9%BA%E7%9B%AE%E5%BD%95%E5%AE%8C%E6%88%90%E6%9C%80%E7%BB%88%E6%BC%94%E7%A4%BA/"/>
<published>2026-09-07T08:00:00.000Z</published>
<summary>
<![CDATA[<p>30 篇文章构建了一个完整的搜索引擎:从爬虫到倒排索引,从 BM25 到向量搜索,从单机到分片,从权限过滤到相关性迭代。</p>
<p>本篇把所有组件打包成一个可以从空目录启动的完整系统,写清楚 README,固定测试数据,提供完整运行脚本,并诚实列出限制。最终演示覆盖查询、修改、删除、模型停机、进程重启、重新查询的全过程。</p>]]>
</summary>
<title>从零构建现代搜索引擎(30):从空目录完成最终演示</title>
<updated>2026-09-17T03:55:37.834Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-29-%E5%BD%A2%E6%88%90%E5%8F%AF%E9%87%8D%E5%A4%8D%E7%9A%84%E7%9B%B8%E5%85%B3%E6%80%A7%E8%BF%AD%E4%BB%A3%E6%B5%81%E7%A8%8B/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-29-%E5%BD%A2%E6%88%90%E5%8F%AF%E9%87%8D%E5%A4%8D%E7%9A%84%E7%9B%B8%E5%85%B3%E6%80%A7%E8%BF%AD%E4%BB%A3%E6%B5%81%E7%A8%8B/"/>
<published>2026-09-07T07:00:00.000Z</published>
<summary>
<![CDATA[<p>前 28 篇构建了一个功能完整的搜索系统。但"能跑"和"搜得好"之间还有距离。搜索相关性需要持续迭代——改了分词器、加了同义词、调了 BM25 参数,怎么判断是变好了还是变差了?</p>
<p>本篇建立可重复的相关性迭代流程:归因失败查询、做盲评、写离线实验报告、设计 A/B 实验。每次变更都有证据支撑接受或拒绝的决定。</p>]]>
</summary>
<title>从零构建现代搜索引擎(29):形成可重复的相关性迭代流程</title>
<updated>2026-09-17T03:55:37.834Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-28-%E6%90%9C%E7%B4%A2%E8%B4%A8%E9%87%8F%E4%B8%8E%E8%AE%BF%E9%97%AE%E8%BE%B9%E7%95%8C/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-28-%E6%90%9C%E7%B4%A2%E8%B4%A8%E9%87%8F%E4%B8%8E%E8%AE%BF%E9%97%AE%E8%BE%B9%E7%95%8C/"/>
<published>2026-09-07T06:00:00.000Z</published>
<summary>
<![CDATA[<p>搜索引擎返回的结果必须尊重访问权限——用户不该看到无权访问的文档,哪怕那个文档与查询高度相关。同时需要过滤垃圾页和限制恶意查询,防止低质量内容和滥用行为影响系统。</p>
<p>本篇在检索内部实现权限过滤,而不是在结果页面上隐藏。同时处理租户隔离、垃圾页过滤、查询限额和缓存泄漏。</p>]]>
</summary>
<title>从零构建现代搜索引擎(28):搜索质量与访问边界</title>
<updated>2026-09-17T03:55:37.834Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-27-%E8%8A%82%E7%82%B9%E6%95%85%E9%9A%9C%E5%A4%87%E4%BB%BD%E4%B8%8E%E6%81%A2%E5%A4%8D/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-27-%E8%8A%82%E7%82%B9%E6%95%85%E9%9A%9C%E5%A4%87%E4%BB%BD%E4%B8%8E%E6%81%A2%E5%A4%8D/"/>
<published>2026-09-07T05:00:00.000Z</published>
<summary>
<![CDATA[<p>上一篇把索引拆成了多个分片。分片解决了容量问题,但带来了新问题:一个分片进程挂了,那个分片上的文档就搜不到了。</p>
<p>本篇用只读副本实现读取冗余,用健康检查发现故障节点,用快照备份保证数据可恢复。目标:停一个进程后查询仍然可用(降级),从快照恢复后数据损失可量化(RPO/RTO)。</p>]]>
</summary>
<title>从零构建现代搜索引擎(27):节点故障、备份与恢复</title>
<updated>2026-09-17T03:55:37.834Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-26-%E6%8A%8A%E6%9F%A5%E8%AF%A2%E5%88%86%E5%8F%91%E5%88%B0%E5%A4%9A%E4%B8%AA%E5%88%86%E7%89%87/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-26-%E6%8A%8A%E6%9F%A5%E8%AF%A2%E5%88%86%E5%8F%91%E5%88%B0%E5%A4%9A%E4%B8%AA%E5%88%86%E7%89%87/"/>
<published>2026-09-07T04:00:00.000Z</published>
<summary>
<![CDATA[<p>单机索引有容量天花板。内存装不下全部 HNSW 向量时,要么做量化压缩(第 22 篇),要么把索引拆到多个进程上。量化只能压缩 4 倍,而索引拆分没有理论上限。</p>
<p>本篇把索引拆成多个分片,用 scatter/gather 模式分发查询,在 coordinator 上合并全局 Top-K。重点处理分片内 BM25 统计偏差和跨分片评分可比性。</p>]]>
</summary>
<title>从零构建现代搜索引擎(26):把查询分发到多个分片</title>
<updated>2026-09-17T03:55:37.834Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-25-%E6%96%B0%E9%B2%9C%E5%BA%A6%E4%B8%8E%E6%8C%81%E7%BB%AD%E9%87%87%E9%9B%86/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-25-%E6%96%B0%E9%B2%9C%E5%BA%A6%E4%B8%8E%E6%8C%81%E7%BB%AD%E9%87%87%E9%9B%86/"/>
<published>2026-09-07T03:00:00.000Z</published>
<summary>
<![CDATA[<p>到目前为止,索引中的文档是一次性灌入的。真实搜索引擎的内容不断变化——新页面发布、旧页面修改、过期页面删除。搜索引擎需要持续追踪这些变化,保持索引的新鲜度。</p>
<p>本篇实现持续采集系统:条件请求避免无谓下载,自适应调度控制抓取节奏,有界队列和背压防止资源耗尽,幂等写入保证重试安全,状态持久化保证重启不丢进度。</p>]]>
</summary>
<title>从零构建现代搜索引擎(25):新鲜度与持续采集</title>
<updated>2026-09-17T03:55:37.834Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-24-%E5%BB%BA%E7%AB%8B%E6%90%9C%E7%B4%A2%E7%9A%84%E6%80%A7%E8%83%BD%E7%94%BB%E5%83%8F/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-24-%E5%BB%BA%E7%AB%8B%E6%90%9C%E7%B4%A2%E7%9A%84%E6%80%A7%E8%83%BD%E7%94%BB%E5%83%8F/"/>
<published>2026-09-07T02:00:00.000Z</published>
<summary>
<![CDATA[<p>搜索系统的各阶段——查询解析、BM25 召回、向量召回、融合、重排——性能特征各不相同。不做测量就不知道瓶颈在哪里,不知道瓶颈就无法有效优化。</p>
<p>本篇为搜索请求建立端到端的性能剖面,用冷热缓存压测暴露真实延迟,用容量账本规划资源预算。</p>]]>
</summary>
<title>从零构建现代搜索引擎(24):建立搜索的性能画像</title>
<updated>2026-09-17T03:55:37.834Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-23-%E6%A8%A1%E5%9E%8B%E5%8D%87%E7%BA%A7%E6%97%B6%E6%80%8E%E6%A0%B7%E9%87%8D%E5%BB%BA%E7%B4%A2%E5%BC%95/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-23-%E6%A8%A1%E5%9E%8B%E5%8D%87%E7%BA%A7%E6%97%B6%E6%80%8E%E6%A0%B7%E9%87%8D%E5%BB%BA%E7%B4%A2%E5%BC%95/"/>
<published>2026-09-07T01:00:00.000Z</published>
<summary>
<![CDATA[<p>embedding 模型会升级。Qwen3-Embedding-0.6B 今天够用,明天可能被更大或更准的版本替代。新模型产生的向量与旧模型不在同一空间——余弦相似度失去意义。</p>
<p>本篇解决一个工程问题:在不中断服务的前提下,用新模型重建整个向量索引,验证质量,原子切换,并在出问题时回滚。</p>]]>
</summary>
<title>从零构建现代搜索引擎(23):模型升级时怎样重建索引</title>
<updated>2026-09-17T03:55:37.834Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-22-%E5%8E%8B%E7%BC%A9%E5%90%91%E9%87%8F%E4%B8%8E%E6%8E%A7%E5%88%B6%E6%8E%A8%E7%90%86%E6%88%90%E6%9C%AC/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-22-%E5%8E%8B%E7%BC%A9%E5%90%91%E9%87%8F%E4%B8%8E%E6%8E%A7%E5%88%B6%E6%8E%A8%E7%90%86%E6%88%90%E6%9C%AC/"/>
<published>2026-09-07T00:00:00.000Z</published>
<summary>
<![CDATA[<p>第 18-19 篇用 float32 向量做 HNSW 搜索。512 维 float32 = 2KB/向量。1 万个 chunk 占 20 MB,尚可接受。但向量数增长到百万级时,内存开销达到 GB 级别——单机装不下,或者装得下但挤占了其他组件的内存预算。</p>
<p>本篇用量化减小向量体积,用缓存和批处理降低 embedding 推理的调用成本。</p>]]>
</summary>
<title>从零构建现代搜索引擎(22):压缩向量与控制推理成本</title>
<updated>2026-09-17T03:55:37.834Z</updated>
</entry>
<entry>
<author>
<name>magicliang</name>
</author>
<category term="技术" scheme="https://magicliang.github.io/categories/%E6%8A%80%E6%9C%AF/"/>
<category term="Java" scheme="https://magicliang.github.io/tags/Java/"/>
<category term="搜索引擎" scheme="https://magicliang.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<category term="Lucene" scheme="https://magicliang.github.io/tags/Lucene/"/>
<category term="信息检索" scheme="https://magicliang.github.io/tags/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/"/>
<category term="从零构建现代搜索引擎" scheme="https://magicliang.github.io/tags/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
<id>https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-21-%E8%AE%A9%E9%87%8D%E6%8E%92%E5%BA%8F%E6%A8%A1%E5%9E%8B%E6%A3%80%E6%9F%A5%E5%80%99%E9%80%89/</id>
<link href="https://magicliang.github.io/2026/09/07/%E4%BB%8E%E9%9B%B6%E6%9E%84%E5%BB%BA%E7%8E%B0%E4%BB%A3%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E-21-%E8%AE%A9%E9%87%8D%E6%8E%92%E5%BA%8F%E6%A8%A1%E5%9E%8B%E6%A3%80%E6%9F%A5%E5%80%99%E9%80%89/"/>
<published>2026-09-06T23:00:00.000Z</published>
<summary>
<![CDATA[<p>上一篇用 RRF 将 BM25 和向量检索的结果合并为一个排名。但 RRF 的融合依据只有排名位置——它不知道候选文档和查询的实际匹配程度。一篇排在 BM25 第 2 名的文档可能因为标题恰好包含查询词而得分高,但正文和查询主题完全无关。</p>
<p>本篇引入重排序模型(reranker),对 RRF 返回的 Top-N 候选逐一做精细评分,找出真正最相关的文档。</p>]]>
</summary>
<title>从零构建现代搜索引擎(21):让重排序模型检查候选</title>
<updated>2026-09-17T03:55:37.834Z</updated>
</entry>
</feed>