| Crates.io | tantivy-jieba |
| lib.rs | tantivy-jieba |
| version | 0.17.0 |
| created_at | 2019-02-13 20:05:21.563709+00 |
| updated_at | 2025-08-26 09:50:44.876761+00 |
| description | A library that bridges between tantivy and jieba-rs |
| homepage | |
| repository | https://github.com/jiegec/tantivy-jieba |
| max_upload_size | |
| id | 114610 |
| size | 799,451 |
An adapter that bridges between tantivy and jieba-rs.
Add dependency tantivy-jieba to your Cargo.toml.
use tantivy::tokenizer::*;
let mut tokenizer = tantivy_jieba::JiebaTokenizer {};
let mut token_stream = tokenizer.token_stream("测试");
assert_eq!(token_stream.next().unwrap().text, "测试");
assert!(token_stream.next().is_none());
use tantivy::schema::Schema;
use tantivy::tokenizer::*;
use tantivy::Index;
let tokenizer = tantivy_jieba::JiebaTokenizer {};
let index = Index::create_in_ram(schema);
index.tokenizers()
.register("jieba", tokenizer);
See examples/mod.rs for detailed example.