A lightweight full-text search engine built in Python.
SearchForge provides fast document indexing, ranking, fuzzy search, autocomplete, highlighting, metadata filtering, persistent storage, and a command-line interface.
pip install searchforgegit clone https://github.com/Ravikalakoti/searchforge.git
cd searchforge
pip install -e .https://pypi.org/project/searchforge/
- Full-text search
- Inverted index based indexing
- TF-IDF ranking
- Tokenization and normalization
- Stop word removal
- Fuzzy search
- Autocomplete suggestions
- Metadata filtering
- Highlighted search results
- Persistent document storage
- Persistent search index
- Search analytics
- Command Line Interface (CLI)
searchforge add sample.txtsearchforge search "python"searchforge statssearchforge --versionfrom searchforge import SearchEngine
engine = SearchEngine()
engine.add_document(
1,
"Python Django Developer"
)
results = engine.search("python")
for result in results:
print(result.document_id)
print(result.score)SearchForge
│
├── Tokenizer
├── Normalizer
├── Stop Words
├── Inverted Index
├── Query Processor
├── Ranking Engine
│ └── TF-IDF
├── Storage
├── Analytics
├── CLI
└── Search Engine
Clone the repository:
git clone https://github.com/Ravikalakoti/searchforge.git
cd searchforgeCreate a virtual environment:
python -m venv .venvActivate the environment:
macOS/Linux
source .venv/bin/activateWindows
.venv\Scripts\activateInstall dependencies:
pip install -e .Run tests:
pytestBuild the package:
python -m buildPublish to PyPI:
twine upload dist/*- Python 3.10+
MIT License.
If you find SearchForge useful, consider supporting my open source work.
Your support helps me continue building and maintaining open source Python projects.
⭐ Sponsor me on GitHub: https://github.com/sponsors/Ravikalakoti
Ravi Singh Kalakoti