]> git.proxmox.com Git - rustc.git/blame - vendor/elasticlunr-rs/README.md
New upstream version 1.64.0+dfsg1
[rustc.git] / vendor / elasticlunr-rs / README.md
CommitLineData
3dfed10e
XL
1# elasticlunr-rs
2
3![Build Status](https://github.com/mattico/elasticlunr-rs/workflows/CI/badge.svg)
4[![Documentation](https://docs.rs/elasticlunr-rs/badge.svg)](https://docs.rs/elasticlunr-rs)
5[![Crates.io](https://img.shields.io/crates/v/elasticlunr-rs.svg)](https://crates.io/crates/elasticlunr-rs)
064997fb 6![Maintenance](https://img.shields.io/badge/Maintenance-Passive-yellow)
3dfed10e
XL
7
8A partial port of [elasticlunr.js][eljs] to Rust. Intended to be used for
9generating compatible search indices.
10
11## Example
12
13```Rust
14use std::fs::File;
15use std::io::Write;
16use elasticlunr::Index;
17
18let mut index = Index::new(&["title", "body"]);
19index.add_doc("1", &["This is a title", "This is body text!"]);
20// Add more documents...
21let mut file = File::create("out.json").unwrap();
22file.write_all(index.to_json_pretty().as_bytes());
23```
24
064997fb
FG
25## Minimum Supported Rust Version
26
271.54.0
28
29## Languages
30
31This library includes optional support for non-English languages, see the features in `Cargo.toml`. Like in the JavaScript
32version, the language support is designed to be compatible with the [lunr-languages plugins][lunr-languages]. Some
33languages use a modified version, which is included in the `js` directory of the repository.
34
3dfed10e
XL
35## License
36
37This repository is offered under the terms of the
38
39- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
40- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
41
42at your option.
43
44Unless you explicitly state otherwise, any contribution intentionally submitted
45for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
46dual licensed as above, without any additional terms or conditions.
47
48Includes code ported from [elasticlunr.js][eljs] Copyright (C) 2017 by Wei Song,
49used under license. See LICENSE-JS for details.
50
51Includes stop word lists ported from [stopwords-filter][swft] Copyright (C) 2012
52David J. Brenes, used under license. See LICENSE-WORDS for details.
53
064997fb
FG
54Bundled javascript code in the repository (not included in the cargo package) may have other licenses.
55
56[lunr-languages]: https://github.com/MihaiValentin/lunr-languages
3dfed10e 57[eljs]: https://github.com/weixsong/elasticlunr.js
064997fb 58[swft]: https://github.com/brenes/stopwords-filter