Skip to main content

A lightweight full-text search engine for Python applications.

Project description

SearchForge

A lightweight full-text search engine for Python.

SearchForge is a pure Python search library that provides fast document indexing, TF-IDF ranking, fuzzy search, autocomplete, metadata filtering, highlighted search results, persistent storage, and a simple command-line interface.

It is designed for developers who need an easy-to-integrate search engine for Python applications without external dependencies.


Installation

Install SearchForge from PyPI:

pip install searchforge

Verify the installation:

searchforge --version

Features

  • Full-text document search
  • Inverted index
  • TF-IDF ranking
  • Tokenization
  • Text normalization
  • Stop-word removal
  • Fuzzy search
  • Autocomplete suggestions
  • Metadata filtering
  • Highlighted search results
  • Persistent document storage
  • Persistent search index
  • Search analytics
  • Command-line interface

Quick Start

from searchforge import SearchEngine

engine = SearchEngine()

engine.add_document(
    1,
    "Python Django Developer"
)

engine.add_document(
    2,
    "FastAPI REST API Tutorial"
)

results = engine.search("python")

for result in results:
    print(result.document_id)
    print(result.score)

CLI

Add a document

searchforge add sample.txt

Search

searchforge search "python"

View search analytics

searchforge stats

Display version

searchforge --version

Basic Search

results = engine.search("django")

Returns a ranked list of matching documents.


Metadata Filtering

engine.add_document(
    1,
    "Python Django Guide",
    metadata={
        "category": "Programming"
    }
)

results = engine.search(
    "python",
    filters={
        "category": "Programming"
    }
)

Autocomplete

engine.suggest("py")

Example output

["python", "pytest"]

Search Analytics

engine.search("python")
engine.search("python")

print(engine.popular_queries())

Example

[("python", 2)]

Project Highlights

  • Pure Python implementation
  • No external search server required
  • Easy to integrate into existing projects
  • Suitable for small to medium-sized applications
  • Published on PyPI
  • Command-line support included

Typical Use Cases

SearchForge can be used in:

  • Django applications
  • Flask applications
  • FastAPI applications
  • Documentation search
  • Portfolio projects
  • Knowledge base systems
  • Blog search
  • Product catalog search
  • Local desktop applications
  • Educational projects

Requirements

  • Python 3.10 or newer

Source Code

GitHub

https://github.com/Ravikalakoti/searchforge

PyPI

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

Issue Tracker

https://github.com/Ravikalakoti/searchforge/issues


License

MIT License


Author

Ravi Singh Kalakoti

Python Backend Developer

GitHub: https://github.com/Ravikalakoti

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

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.2.tar.gz (13.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.2-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: searchforge-0.1.2.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for searchforge-0.1.2.tar.gz
Algorithm Hash digest
SHA256 21cf68cb242659904e7b1c6603bac3b5878f27d6a7340e541817f76ab0af0e11
MD5 e1b831ea4de13abddba5a9920cb4f3bf
BLAKE2b-256 6a6b9b73e1d185e3449b757b6c42b1396c1b193b02b43971ae03c3d8fc7718f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for searchforge-0.1.2.tar.gz:

Publisher: publish.yml on Ravikalakoti/searchforge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: searchforge-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for searchforge-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bd550598745dd2a699fdc52a4c94545f5acc3cc0ed294e3b728c5786d1928380
MD5 cc8179e82a646d30b4207cdc2e35ce8d
BLAKE2b-256 1345bb14ea1be7dc52073602978eccf3a0bc693e6ed22c41413f2efad0618f30

See more details on using hashes here.

Provenance

The following attestation bundles were made for searchforge-0.1.2-py3-none-any.whl:

Publisher: publish.yml on Ravikalakoti/searchforge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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