Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Local File Search Engine from Scratch

A high-performance Python-based search engine designed to execute text queries over local file collections. The project documents an evolutionary engineering path: transitioning from baseline information retrieval library dependencies to a custom, zero-dependency Inverted Index implementation.

This project demonstrates core competencies in tokenization, information retrieval mechanics, index mapping structures, and algorithmic optimization.

Architectural Evolution

Phase 1: Library-Driven Implementation

The initial proof-of-concept leveraged standard parsing packages to handle document collection and search matching routines. This served as a baseline system to evaluate query accuracy and profile retrieval behavior.

Phase 2: Custom Inverted Index from Scratch

To optimize performance and eliminate black-box runtime behavior, the engine was refactored into an optimized, pure-Python architecture built around an Inverted Index:

  • Mapping Framework: Documents are tokenized into normalized terms. The index maps each unique term to a posting list containing specific Document IDs where the term appears.
  • $O(1)$ Average Lookup Complexity: Replaces slow sequential file scanning with instant hash-table matching using Python dictionaries.
  • Multi-Word Intersections: Implements custom parsing algorithms to support multi-word queries, resolving matches by evaluating the intersection of active posting lists.

Project Features & Components

  • Data Normalization Pipe: Sanitizes input files by handling case folding and stripping punctuation to ensure high-fidelity term matching.
  • Automated Directory Discovery: Scans an isolated local data directory, dynamically processing files and mapping them into memory.
  • Multi-Word Search Capability: Resolves basic 1–2 word queries using optimized Boolean set logic across posting chains.

About

Making a basic search engine from scratch. to search within local files.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages