postings
Inverted-index postings lists with segment-style updates.
Supports u32 term frequencies (classical IR) and f32 weights
(SPLADE / learned-sparse retrieval).
Data Model & Invariants
- Doc IDs:
u32. Must be dense/contiguous for optimal compression. - Ordering: Postings lists are always sorted by Doc ID.
- Updates: Segment-based. Deletions are tombstones; updates are delete+add.
- Storage: In-memory by default. Persistence via
durability(optional).
Usage
[]
= “0.1”
Example (index + candidates):
use ;
let mut idx = new;
idx.add_document
.unwrap;
idx.add_document
.unwrap;
// Conjunctive (AND) candidates.
assert_eq!;
let cfg = default;
let plan = idx.plan_candidates;
assert!;
Features
postings/serde: enable serde for the in-memory structures.postings/persistence: enable save/load helpers viadurability+postcard.postings/sbits: enable succinct monotone sequences (Elias–Fano) underpostings::codec::ef.postings/positional: enable positional postings (postings::positional::PosingsIndex).postings/cnk-compression: enable optional compressed-candidate helpers underpostings::positional::cnk_candidates.
Optional: positional postings
Enable positional postings behind a feature flag:
[]
= { = "0.1", = ["positional"] }
Then use postings::positional::PosingsIndex for phrase/proximity evaluation.
Development