Metadata-Version: 2.4
Name: searchforge
Version: 0.1.1
Summary: A lightweight full-text search engine for Python applications.
Author: Ravi Singh Kalakoti
License-Expression: MIT
Project-URL: Homepage, https://github.com/Ravikalakoti/searchforge
Project-URL: Repository, https://github.com/Ravikalakoti/searchforge
Project-URL: Documentation, https://github.com/Ravikalakoti/searchforge#readme
Project-URL: Issues, https://github.com/Ravikalakoti/searchforge/issues
Keywords: search,search-engine,full-text-search,information-retrieval,tf-idf,python,indexing,autocomplete,fuzzy-search
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Text Processing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# SearchForge

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.

## Installation

### Install from PyPI (Recommended)

```bash
pip install searchforge
```

### Install from Source

```bash
git clone https://github.com/<your-github-username>/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

```bash
searchforge add sample.txt
```

### Search documents

```bash
searchforge search "python"
```

### View search analytics

```bash
searchforge stats
```

### Show version

```bash
searchforge --version
```

## Python Usage

```python
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

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

## Development

Clone the repository:

```bash
git clone https://github.com/<your-github-username>/searchforge.git
cd searchforge
```

Create a virtual environment:

```bash
python -m venv .venv
```

Activate the environment:

**macOS/Linux**

```bash
source .venv/bin/activate
```

**Windows**

```bash
.venv\Scripts\activate
```

Install dependencies:

```bash
pip install -e .
```

Run tests:

```bash
pytest
```

Build the package:

```bash
python -m build
```

Publish to PyPI:

```bash
twine upload dist/*
```

## Requirements

- Python 3.10+

## License

MIT License.

## Author

**Ravi Singh Kalakoti**

- GitHub: https://github.com/Ravikalakoti
- PyPI: https://pypi.org/project/searchforge/
