Expand description
§elasticlunr-rs
A partial port of elasticlunr to Rust. Intended to be used for generating compatible search indices.
Access to all index-generating functionality is provided. Most users will only need to use the
Index
or IndexBuilder
types.
The Language
trait can be used to implement a custom language.
§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 docs...
let mut file = File::create("out.json").unwrap();
file.write_all(index.to_json_pretty().as_bytes());
Re-exports§
Modules§
- config
- These types are not used for generating
Index
es. They are provided to help with creating compatible JSON structures for configuring the JavaScript search function. - document_
store - Implements an elasticlunr.js document store. Most users do not need to use this module directly.
- inverted_
index - Implements an elasticlunr.js inverted index. Most users do not need to use this module directly.
- lang
- Intended to be compatible with https://github.com/MihaiValentin/lunr-languages. Each supported language has a trimmer, a stop word filter, and a stemmer. Most users will not need to use these modules directly.
- pipeline
- Defines the pipeline which processes text for inclusion in the index. Most users do not need to use this module directly.
Structs§
- Index
- An elasticlunr search index.
- Index
Builder - A builder for an
Index
with custom parameters.
Constants§
- ELASTICLUNR_
VERSION - The version of elasticlunr.js this library was designed for.