Skip to content

feat: Implement Inverted Index (BM25) with Elias-Fano and Varint comp… - #11

Merged
Lotargo merged 1 commit into
mainfrom
feature-inverted-index-bm25-787364429202978620
Mar 10, 2026
Merged

Lotargo merged 1 commit into
mainfrom
feature-inverted-index-bm25-787364429202978620

Conversation

@Lotargo

@Lotargo Lotargo commented Mar 10, 2026

Copy link
Copy Markdown
Owner

…ression

This commit introduces the Inverted Index for lexical search, which is a key component of the Hybrid RAG engine.

Key changes:

  • Added libstemmer to vcpkg.json for robust multi-language stemming and tokenization.
  • Created Tokenizer wrapper around libstemmer with basic stop-word filtering.
  • Implemented Varint and EliasFanoEncoder/Decoder for efficient compression of posting lists (tf and doc_id respectively).
  • Developed InvertedIndexBuilder for constructing the index in memory and serializing it to a custom binary format.
  • Developed DiskInvertedIndex for reading the binary format via mmap without allocating memory for posting lists (zero-copy).
  • Added comprehensive unit tests in tests/test_compression.cpp, tests/test_tokenizer.cpp, and tests/test_inverted_index.cpp.
  • Updated TODO.md, roadmap.md, and patterns.md to mark the task as complete.

Tests were successfully run using gtest and compiled with GCC 13.

…ression

This commit introduces the Inverted Index for lexical search, which is a
key component of the Hybrid RAG engine.

Key changes:
- Added `libstemmer` to `vcpkg.json` for robust multi-language stemming
  and tokenization.
- Created `Tokenizer` wrapper around `libstemmer` with basic stop-word
  filtering.
- Implemented `Varint` and `EliasFanoEncoder/Decoder` for efficient
  compression of posting lists (`tf` and `doc_id` respectively).
- Developed `InvertedIndexBuilder` for constructing the index in memory
  and serializing it to a custom binary format.
- Developed `DiskInvertedIndex` for reading the binary format via `mmap`
  without allocating memory for posting lists (zero-copy).
- Added comprehensive unit tests in `tests/test_compression.cpp`,
  `tests/test_tokenizer.cpp`, and `tests/test_inverted_index.cpp`.
- Updated `TODO.md`, `roadmap.md`, and `patterns.md` to mark the task
  as complete.

Tests were successfully run using `gtest` and compiled with GCC 13.
@Lotargo
Lotargo merged commit 8df50f7 into main Mar 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant