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
// SPDX-License-Identifier: Apache-2.0
//! `FtsSegmentExt` — pagedb segment operations for FTS memtable posting data.
//!
//! The `StorageEngine` trait handles sparse, sorted, key-value state. For FTS
//! posting data (potentially large per-index blobs, sequentially read on
//! cold-open restore) pagedb segments are the appropriate backing. Bundling
//! all term postings for one index key into a single segment reduces B+ tree
//! pressure from O(vocab_size) entries to O(1) per index key.
//!
//! Term dictionary entries, doc-length tables, surrogate maps, and collection
//! metadata remain on the B+ tree (`Namespace::Fts`) — they are genuinely
//! sparse and sorted.
//!
//! Only compiled on non-WASM targets. WASM stays on the KV blob path.
use crateLiteError;
/// Extension trait: write, open, delete, and list FTS posting segments backed
/// by pagedb encrypted segment files.
///
/// One segment per FTS index key (e.g. `"articles"` or `"articles:title"`). The segment
/// contains the serialized posting blob exactly as produced by the checkpoint
/// layer — no additional framing beyond the 8-byte length prefix envelope used
/// to survive pagedb's page-boundary padding.
///
/// This trait is object-safe so `StorageEngine` implementations can return
/// `Option<&dyn FtsSegmentExt>` via `as_fts_segment_ext()`.