heroindex-0.1.3 is not a library.
HeroIndex
A high-performance full-text search server built on Tantivy, exposing an OpenRPC interface over Unix sockets.
Repository: https://forge.ourworld.tf/lhumina_research/hero_index_server
Looking for the client library? See heroindex_client for easy integration into your Rust applications.
Features
- Multiple Index Management - Create, delete, and manage multiple search indexes
- Dynamic Schemas - Define custom schemas with 10+ field types
- Powerful Queries - Full-text, fuzzy, phrase, boolean, range, regex queries
- OpenRPC Discovery - Self-documenting API via
rpc.discover - Concurrent Connections - Handle multiple clients simultaneously
- Fast Fields - Columnar storage for sorting and aggregations
- Zero-Copy Search - Efficient memory-mapped index files
Installation
From crates.io
From source
Quick Start
1. Start the Server
2. Connect with the Client Library
Use heroindex_client to connect:
use HeroIndexClient;
use json;
async
Command Line Options
heroindex [OPTIONS]
Options:
-d, --dir <DIR> Base directory for all indexes
-s, --socket <SOCKET> Unix socket path for RPC interface
-h, --help Print help
-V, --version Print version
Schema Definition
Define your index schema with these field types:
| Type | Description | Options |
|---|---|---|
text |
Full-text searchable (tokenized) | stored, indexed, fast, tokenizer |
str |
Exact match string (keyword) | stored, indexed, fast |
u64 |
Unsigned 64-bit integer | stored, indexed, fast |
i64 |
Signed 64-bit integer | stored, indexed, fast |
f64 |
64-bit floating point | stored, indexed, fast |
date |
DateTime (RFC 3339) | stored, indexed, fast |
bool |
Boolean | stored, indexed, fast |
json |
JSON object | stored, indexed |
bytes |
Binary data | stored, indexed, fast |
ip |
IP address | stored, indexed, fast |
Example Schema
Query Types
Match Query (Full-Text)
Term Query (Exact)
Fuzzy Query (Typo-Tolerant)
Phrase Query
Prefix Query
Range Query
Regex Query
Boolean Query
RPC Methods
| Method | Description |
|---|---|
rpc.discover |
Get OpenRPC schema |
server.ping |
Health check |
server.stats |
Server statistics |
db.list |
List all databases |
db.create |
Create database with schema |
db.delete |
Delete a database |
db.select |
Select database for operations |
db.info |
Get database info |
schema.get |
Get current schema |
doc.add |
Add single document |
doc.add_batch |
Add multiple documents |
doc.delete |
Delete by term |
index.commit |
Commit changes |
index.reload |
Reload to see changes |
search.query |
Execute search |
search.count |
Count matches |
Performance Tips
- Use batch inserts -
doc.add_batchis much faster than individual adds - Commit periodically - Don't commit after every document
- Enable fast fields - For fields used in sorting/filtering
- Use appropriate tokenizers -
en_stemfor English,rawfor keywords
Related Crates
- heroindex_client - Client library for connecting to HeroIndex
License
MIT License - see LICENSE for details.
Credits
Built on the excellent Tantivy search engine library.