A simple yet powerful offline search engine built in Python. It indexes a folder of plain text files and lets you search through them instantly using keyword queries. Perfect for fast document lookup, LLM notes retrieval, and offline NLP-based search experiments.
- Full-text search over .txt files
- Inverted Index for fast lookup
- Contextual snippets from matching lines
- Command Line
- No internet required (fully offline)
- Python 3
- os, re, collections (for indexing)
- The script reads all .txt files inside the docs/ folder.
- An inverted index is built mapping each word to the documents and line numbers it appears in.
- The user enters a search query (single word or multiple keywords).
- It returns matching file names and lines containing the terms.
-
Clone the repo:
git clone https://github.com/your-username/mini-search-engine.git cd mini-search-engine
-
Add your .txt files into the docs/ folder.
-
To run the command-line version:
python search.py
-
To use the Streamlit UI (optional):
pip install streamlit streamlit run app.py
Search for AI terms like:
> Enter your search query: transformer
Returns:
Found in: llm_fundamentals.txt
- Line 4: Transformer architecture revolutionized NLP.
- All files must be in plain .txt format inside the docs/ directory.
- No internet or external API required — works offline.
- Ideal for personal note search, educational summaries, and ML paper references.
Student | Cloud + Python Enthusiast
JSS Science and Technology University