Crates.io | tantivy-macro |
lib.rs | tantivy-macro |
version | 0.1.0 |
source | src |
created_at | 2023-11-19 09:05:26.61327 |
updated_at | 2023-11-19 09:05:26.61327 |
description | derive tantivy schema api |
homepage | |
repository | https://github.com/thlstsul/tantivy-macro |
max_upload_size | |
id | 1041028 |
size | 32,003 |
Derive schema function return tantivy::schema::Schema; And impl into tantivy::schema::Document.
#[derive(Schema)]
pub struct Doc {
#[field(name = "str", stored, indexed)]
text: String,
#[field(fast, norm, coerce, indexed)]
num: u64,
#[field(stored, indexed, fast)]
date: DateTime,
#[field(stored, indexed)]
facet: Facet,
#[field(stored, indexed)]
bytes: Vec<u8>,
#[field(stored, indexed)]
json: Map<String, Value>,
#[field(fast, indexed)]
ip: Ipv6Addr
}