This repository implements the indexing and search backend of a custom-built web search engine, written in Python. It efficiently constructs a disk-based inverted index using partial indexing, and supports ranked document retrieval using TF-IDF and PageRank.
🕷️ Crawling is handled by a separate, dedicated crawler built from scratch to handle:
- Politeness rules and robot exclusion
- Trap detection and loop prevention
- Subdomain tracking and content filtering
👉 Visit the crawler repo here: Web Crawler Repository
This repository handles:
- Parsing crawled data from
developer.zip - Tokenization, stemming, and stopword filtering
- Partial inverted index creation and memory-efficient merging
- TF-IDF and PageRank scoring
- Boolean and ranked search queries
- Support for boosting based on HTML structure (e.g., titles, headers, bold text)
- Optional support for n-grams, word positions, and anchor text indexing
web-search-engine/
├── src/ # All source code and modules
├── index/ # (Ignored) Generated indexes after running the pipeline
├── developer.zip # Crawled data archive (not included in repo)
├── README.md
└── .gitignore
git clone https://github.com/rbelavadi/web-search-engine.git
cd web-search-engineThe dataset used is developer.zip — a zip archive of ~38,000 HTML pages collected from ics.uci.edu and related UCI subdomains.
These pages were crawled using a custom-built crawler (see Web Crawler Repository) and include faculty profiles, research pages, and course descriptions.
🔗 Download here: Google Drive link to developer.zip 📁 Place the file in the root folder of the project.
This step parses the HTML documents, tokenizes them, and builds a TF-IDF–weighted inverted index.
python src/buildindex.pyThis launches a console-based query interface that supports ranked and Boolean search.
python src/startMyEngine.pyThe index/ folder is ignored via .gitignore and will be regenerated when main.py is run.
developer.zip must be added manually; it contains HTML pages generated by the custom crawler.
The web crawler is a separate project and includes advanced crawling features. You can find it here: Web Crawler Repository
Ranjani Belavadi
CS & BIM @ UC Irvine
Python | Systems | Information Retrieval