This project is a search engine web application built with Flask, implemented using two separate Python scripts, each serving a different dataset and functionality:
-
📚
SearchEngine.py: A search engine for Harry Potter books & characters.
Includes boolean retrieval, term frequency ranking, stopword removal, and approximate character name matching using Levenshtein distance. -
🎵
MusicSearchEngine.py: A search engine for song lyrics.
Includes boolean retrieval, term frequency ranking, and stopword removal.
Both engines are independent and provide their own web interfaces.
This project demonstrates core Information Retrieval (IR) concepts, Text Preprocessing, and Web Deployment with Flask.
- Python 3
- Flask
- HTML
- python-Levenshtein (used in
SearchEngine.py)
git clone https://github.com/Irvandmw/SearchEngineOptimizationProject.git
cd SearchEngineOptimizationProjectpip install flask python-Levenshtein📚 Book & Character Mode (SearchEngine.py)
-
Place .txt book files in:
static/data/
-
Place characters.json in:
static/assets/characters/
python SearchEngine.pyThe browser will automatically open at:
http://127.0.0.1:5000/python MusicSearchEngine.pyThe browser will automatically open at:
http://127.0.0.1:5000/- Boolean Retrieval: Finds books containing all query terms.
- Term Frequency Ranking: Ranks books by frequency of query terms.
- Stopword Removal: Removes common stopwords for relevance.
- Approximate Character Matching: Suggests the closest character name for misspelled queries using Levenshtein distance.
- Reading Mode: Displays the full book content.
- Boolean Retrieval: Finds songs containing all query terms.
- Term Frequency Ranking: Ranks songs by frequency of query terms.
- Stopword Removal: Removes common stopwords.
- Reading Mode: Displays the full song lyrics.
This project is shared with the intention to help others learn and explore.
You are welcome to use, modify, or extend this project for your own educational or personal purposes.
However, if you do use this project in any way,
please kindly include proper credit to the original author by mentioning:
🔗 Contact:
Giving credit helps acknowledge the effort behind this work and supports open collaboration.
Thank you for respecting the creator’s contribution! 🌱