|
Introduction
A simple full-text search engine written in C# with no external dependencies.
The aim of this project is to showcase the algorithms, data structures, and techniques used to create full-text search engines.
 Source Repository
Query Language
- WORD(apple) - single word
- WILD(app*) - wildcard pattern
- EDIT(apple, 1) - Levenshtein distance (edit distance, fuzzy search)
Combining operators:
- OR - Boolean OR
- AND - Boolean AND
- SEQ - sequence of words, phrase
Examples of queries:
- AND(WORD(apple), OR(WILD(a*), EDIT(apple, 1)))
- SEQ(WORD(hello), WORD(world))
Data Structures
- The dictionary of the persistent index is implemented using:
- Key-value storage for document metadata is based on a persistent B-Tree implementation.
- Packed Integers.
- Classic data structures:
Algorithms
- Approximate term matching is based on a Levenshtein automaton.
- The query language parser is implemented using a recursive descent parser.
- The method for encoding and decoding occurrences uses:
- Classic algorithms:
- Binary search
- Heap sort
- Huffman encoding
References
|