Repository navigation
feat: Implement Inverted Index (BM25) with Elias-Fano and Varint comp… - #11
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ression
This commit introduces the Inverted Index for lexical search, which is a key component of the Hybrid RAG engine.
Key changes:
libstemmertovcpkg.jsonfor robust multi-language stemming and tokenization.Tokenizerwrapper aroundlibstemmerwith basic stop-word filtering.VarintandEliasFanoEncoder/Decoderfor efficient compression of posting lists (tfanddoc_idrespectively).InvertedIndexBuilderfor constructing the index in memory and serializing it to a custom binary format.DiskInvertedIndexfor reading the binary format viammapwithout allocating memory for posting lists (zero-copy).tests/test_compression.cpp,tests/test_tokenizer.cpp, andtests/test_inverted_index.cpp.TODO.md,roadmap.md, andpatterns.mdto mark the task as complete.Tests were successfully run using
gtestand compiled with GCC 13.