qdrant-edge
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBuilding on Qdrant Edge
基于Qdrant Edge开发
Edge is the Qdrant engine embedded in your process (Python or Rust), not a thin local vector store to wrap. The failure mode is rebuilding what the shard already ships: keyword scoring, snapshot apply, faceting, counting. Before writing any of that, check the shard API. Two things Edge does NOT give you are a one-call cloud sync and query-time fusion, so knowing which is which keeps you from both reinventing built-ins and expecting capabilities Edge lacks. Edge is single-node and shares the server's data format.
- Edge is in beta: pin your version, the API drifts between releases Qdrant Edge.
Edge是嵌入到您进程(Python或Rust)中的Qdrant引擎,而非用于封装的轻量本地向量存储。常见误区是重复开发分片已内置的功能:关键词评分、快照应用、分面搜索、计数等。在编写任何代码前,请先查看分片API。Edge不提供两项功能:一键云同步和查询时融合,了解这一点既能避免重复造轮子,也不会对Edge抱有超出其能力的期望。Edge为单节点架构,与服务器的数据格式兼容。
- Edge目前处于测试版:请固定您使用的版本,不同版本间API可能存在差异 Qdrant Edge。
Syncing a Shard with a Qdrant Server
将分片与Qdrant服务器同步
Use when: seeding a shard from a server, keeping it fresh, backing it up, or aggregating many devices into one collection.
There is no built-in . Sync is a pattern you assemble from shard helpers plus your own transport, so do not go looking for one call.
.sync()- Follow the documented dual-shard pattern: a shard for local writes plus an
mutableshard restored from a server snapshot, query both, refresh on a schedule Edge synchronization guide.immutable - You write the snapshot download (plain HTTP to the shard snapshot endpoint), then apply it with and
unpack_snapshot. Do not untar or merge segments by hand Synchronization patterns.update_from_snapshot - Refresh incrementally with a partial snapshot built from , not a full snapshot every cycle Synchronization patterns.
snapshot_manifest - Push is your own dual-write: on each local upsert, enqueue the point and let a background worker upsert it to the server, buffering while offline Synchronization patterns.
适用场景:从服务器初始化分片、保持分片数据更新、备份分片,或是将多个设备的数据聚合到一个集合中。
Edge没有内置的方法。同步是一种需要您结合分片辅助工具与自定义传输逻辑来实现的模式,因此不要寻找一键同步的方法。
.sync()- 遵循文档中记录的双分片模式:一个用于本地写入的分片,加上一个从服务器快照恢复的
mutable分片,同时查询这两个分片,并按计划刷新数据 Edge同步指南。immutable - 您需要自行实现快照下载(通过普通HTTP请求访问分片快照端点),然后使用和
unpack_snapshot来应用快照。请勿手动解压或合并分片段 同步模式。update_from_snapshot - 使用生成的部分快照进行增量刷新,而非每次周期都使用完整快照 同步模式。
snapshot_manifest - 推送功能需要您自行实现双写逻辑:每次本地插入数据时,将该点加入队列,由后台工作线程将其插入到服务器,离线时可进行缓冲 同步模式。
Keyword and Hybrid Search on Device
设备端关键词与混合搜索
Use when: you need exact-term or BM25 matching, alone or alongside vectors.
- BM25 is built into Edge (,
Bm25,Bm25Config,embed_document) with the IDFembed_queryonModifier, and is wire-compatible with server BM25: a shard seeded from a server snapshot answers local BM25 queries without re-indexing. Do not ship a second BM25 library Edge BM25EdgeSparseVectorParams - Dense embeddings are NOT in Edge: generate them on device with the separate package FastEmbed embeddings
fastembed - Edge queries one vector field per request () and does not fuse dense and sparse at query time. Run each leg separately and combine the rankings in application code Edge quickstart
using
适用场景:您需要精确术语匹配或BM25匹配,无论是单独使用还是与向量搜索结合。
- Edge内置了BM25功能(、
Bm25、Bm25Config、embed_document),在embed_query上支持IDFEdgeSparseVectorParams,且与服务器端BM25兼容:从服务器快照初始化的分片无需重新索引即可响应本地BM25查询。请勿引入第二个BM25库 Edge BM25Modifier - Edge不包含密集嵌入向量生成功能:需使用单独的包在设备端生成 FastEmbed嵌入向量
fastembed - Edge每次请求仅能查询一个向量字段(通过参数指定),且不支持查询时融合密集向量与稀疏向量。需分别执行两种查询,然后在应用代码中合并排名结果 Edge快速入门
using
Operating the Shard
分片运维
Use when: writes have accumulated, search looks stale after inserts, or a backup is larger than the data.
- Edge has NO background optimizer. Call after bulk writes: it builds indexes (including the sparse index) and reclaims deleted points. Skip it and that data stays unindexed Edge quickstart
optimize - Faceting, counting, and enumeration are built in (,
facet,count); index the fields you filter or facet withscrollrather than aggregating in application code Edge quickstartcreate_field_index - The write-ahead log is pre-allocated to 32 MB and inflates apparent disk and backup size. Shrink it with (Rust), and do not treat raw file size as real usage Edge quickstart
wal_options
适用场景:写入数据累积、插入后搜索结果显示过时,或是备份文件大于实际数据量。
What NOT to Do
请勿执行以下操作
- Expect a bidirectional or a built-in push path: Edge gives you snapshot apply, you own the transport and the dual-write
.sync() - Untar or merge snapshot segments by hand instead of using and
unpack_snapshotupdate_from_snapshot - Ship a custom or third-party BM25 when Edge has one built in
- Use for queries or
embed_documentfor documents: the weighting differs and results go wrongembed_query - Assume Edge fuses dense and sparse or consumes Prefetch: combine the rankings in application code
- Assume a background optimizer like the server's: nothing is indexed or compacted until you call
optimize - Reach for Edge when you need distributed or multi-node search: it is single-node Qdrant Edge
- Claim support for a language beyond Python and Rust, or an OS or accelerator the Edge docs do not state
- 期望Edge提供双向方法或内置推送路径:Edge仅提供快照应用功能,传输逻辑和双写逻辑需由您自行实现
.sync() - 手动解压或合并快照分片段,而非使用和
unpack_snapshotupdate_from_snapshot - 在Edge已内置BM25功能的情况下,使用自定义或第三方BM25库
- 将用于查询或
embed_document用于文档:两者的权重计算不同,会导致结果错误embed_query - 假设Edge支持密集向量与稀疏向量融合或Prefetch功能:需在应用代码中合并排名结果
- 假设Edge具备与服务器类似的后台优化器:在调用前,数据不会被索引或压缩
optimize - 在需要分布式或多节点搜索时使用Edge:它是单节点架构 Qdrant Edge
- 声称支持Python和Rust之外的语言,或是Edge文档未提及的操作系统或加速器