Overview
Query engine: text query → n-grams → index lookup → posting list intersection → BM25F scoring → ranked results.
Module: crates/rskim-search/src/lexical/query.rs (~200 lines)
Pipeline
Query string → extract_query_ngrams → lookup each in index (binary search .skidx) → load posting lists (mmap .skpost) → intersect (sorted merge) → score (BM25F) → sort by score → top-K
Optimizations
- Process rarest n-gram first (smallest posting list) — "cheapest first" strategy
- Lazy posting list iteration (never fully materialize)
- Early termination when top-K scores can't be exceeded
Dependencies
Acceptance Criteria
Implementation Guidelines Checklist
Overview
Query engine: text query → n-grams → index lookup → posting list intersection → BM25F scoring → ranked results.
Module:
crates/rskim-search/src/lexical/query.rs(~200 lines)Pipeline
Query string → extract_query_ngrams → lookup each in index (binary search .skidx) → load posting lists (mmap .skpost) → intersect (sorted merge) → score (BM25F) → sort by score → top-K
Optimizations
Dependencies
Acceptance Criteria
Implementation Guidelines Checklist