rustc/vendor/elasticlunr-rs
2020-09-04 16:38:49 +01:00
..
benches New upstream version 1.47.0~beta.2+dfsg1 2020-09-04 16:38:49 +01:00
examples New upstream version 1.47.0~beta.2+dfsg1 2020-09-04 16:38:49 +01:00
src New upstream version 1.47.0~beta.2+dfsg1 2020-09-04 16:38:49 +01:00
tests New upstream version 1.47.0~beta.2+dfsg1 2020-09-04 16:38:49 +01:00
.cargo-checksum.json New upstream version 1.47.0~beta.2+dfsg1 2020-09-04 16:38:49 +01:00
Cargo.lock New upstream version 1.47.0~beta.2+dfsg1 2020-09-04 16:38:49 +01:00
Cargo.toml New upstream version 1.47.0~beta.2+dfsg1 2020-09-04 16:38:49 +01:00
LICENSE-APACHE New upstream version 1.47.0~beta.2+dfsg1 2020-09-04 16:38:49 +01:00
LICENSE-JS New upstream version 1.47.0~beta.2+dfsg1 2020-09-04 16:38:49 +01:00
LICENSE-MIT New upstream version 1.47.0~beta.2+dfsg1 2020-09-04 16:38:49 +01:00
LICENSE-WORDS New upstream version 1.47.0~beta.2+dfsg1 2020-09-04 16:38:49 +01:00
README.md New upstream version 1.47.0~beta.2+dfsg1 2020-09-04 16:38:49 +01:00

elasticlunr-rs

Build Status Documentation Crates.io

A partial port of elasticlunr.js to Rust. Intended to be used for generating compatible search indices.

Example

use std::fs::File;
use std::io::Write;
use elasticlunr::Index;

let mut index = Index::new(&["title", "body"]);
index.add_doc("1", &["This is a title", "This is body text!"]);
// Add more documents...
let mut file = File::create("out.json").unwrap();
file.write_all(index.to_json_pretty().as_bytes());

License

This repository is offered under the terms of the

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Includes code ported from elasticlunr.js Copyright (C) 2017 by Wei Song, used under license. See LICENSE-JS for details.

Includes stop word lists ported from stopwords-filter Copyright (C) 2012 David J. Brenes, used under license. See LICENSE-WORDS for details.