Skip to content

About

A Python-based search engine implementing inverted index, ranking algorithms, fuzzy search, and autocomplete.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

SearchForge

A lightweight full-text search engine built in Python.

GitHub Sponsors

SearchForge provides fast document indexing, ranking, fuzzy search, autocomplete, highlighting, metadata filtering, persistent storage, and a command-line interface.

Installation

Install from PyPI (Recommended)

pip install searchforge

Install from Source

git clone https://github.com/Ravikalakoti/searchforge.git
cd searchforge
pip install -e .

PyPI

https://pypi.org/project/searchforge/

Features

  • 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)

CLI Usage

Add a document

searchforge add sample.txt

Search documents

searchforge search "python"

View search analytics

searchforge stats

Show version

searchforge --version

Python Usage

from 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)

Project Architecture

SearchForge
│
├── Tokenizer
├── Normalizer
├── Stop Words
├── Inverted Index
├── Query Processor
├── Ranking Engine
│   └── TF-IDF
├── Storage
├── Analytics
├── CLI
└── Search Engine

Development

Clone the repository:

git clone https://github.com/Ravikalakoti/searchforge.git
cd searchforge

Create a virtual environment:

python -m venv .venv

Activate the environment:

macOS/Linux

source .venv/bin/activate

Windows

.venv\Scripts\activate

Install dependencies:

pip install -e .

Run tests:

pytest

Build the package:

python -m build

Publish to PyPI:

twine upload dist/*

Requirements

  • Python 3.10+

License

MIT License.

Support

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

Author

Ravi Singh Kalakoti

About

A Python-based search engine implementing inverted index, ranking algorithms, fuzzy search, and autocomplete.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages