search5-0.2.2 is not a library.
search5 - Local File Search Engine
A lightweight full-text search engine for local HTML files, built with Rust and Axum. Supports Chinese text search using n-gram indexing.
Features
- Full-text search - Search through local HTML files with n-gram indexing
- Chinese language support - No tokenizer required, handles Chinese naturally
- Web UI - Clean interface with htmx + Tailwind CSS
- REST API - Programmatic access to search functionality
- Persistent index - Index persists across server restarts
Quick Start
# Build the project
# Run the server
Server runs at http://127.0.0.1:3000
Build Index
Before searching, you need to build the index:
This indexes all .html files in the data/ directory.
Web Interface
- Home page: http://127.0.0.1:3000/
- Search: http://127.0.0.1:3000/search?q=keyword
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /index |
Build index from directory |
| GET | /index/status |
Get index statistics |
| GET | /api/search?q=keyword |
Search via API |
| GET | /data/:file |
Serve static HTML files |
Example
# Build index
# Search via API
# Check index status
Development
# Run tests
# Or individually:
Project Structure
src/
├── main.rs # Entry point
├── indexer/ # Index building with nanofts
├── parser/ # HTML parsing
├── api/ # REST API routes
└── ui/ # Web UI handlers & templates
Tech Stack
- Backend: Rust, Axum, tokio
- Search: nanofts (n-gram full-text search)
- HTML parsing: scraper
- Frontend: htmx, Tailwind CSS (via CDN)
- Templates: minijinja
License
MIT