Skip to main content

A lightweight search engine for Python applications

Project description

# SearchForge

A lightweight full-text search engine built in Python.

SearchForge provides fast document indexing, ranking, fuzzy search, autocomplete, highlighting, filtering and persistent storage.

## Features

- Full-text search
- Inverted index based indexing
- TF-IDF and BM25 ranking
- Tokenization and normalization
- Stop word removal
- Fuzzy search
- Autocomplete suggestions
- Metadata filtering
- Highlighted search results
- Persistent document storage
- Persistent index storage
- Search analytics
- Command line interface (CLI)

## Installation

Clone the repository:

```bash
git clone <repository-url>
cd searchforge

Install:

pip install -e .

CLI Usage

Add a document:

searchforge add sample.txt

Search:

searchforge search "python"

View analytics:

searchforge stats

Check 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, result.score)

Architecture

SearchForge

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

Development

Run tests:

pytest

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

searchforge-0.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

searchforge-0.1.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file searchforge-0.1.0.tar.gz.

File metadata

  • Download URL: searchforge-0.1.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for searchforge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 54387a91f3c62c8ead2f5de2013ebc0cb2e230eed5d6bdb7329452610b4a3ce3
MD5 663d11541fc3e3a56183e2707f5f0a83
BLAKE2b-256 652bbec6f14c0d76ba1026415e24d00809c7820cada494cff8a6f479636bfd04

See more details on using hashes here.

File details

Details for the file searchforge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: searchforge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for searchforge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ea87fe5b16b0eb060bb4c9f7e45bbaa41105533c012c74c45f55fc48b3eb11e
MD5 2793a52ceaeb67a5d996d846ce9a3473
BLAKE2b-256 2f220e8b4d326b5a6e716210d0351f719afd04f1156c95e8816e9f94b0446534

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page