Crate elasticlunr

source ·
Expand description

elasticlunr-rs

Build Status Documentation Crates.io

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.

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

pub use lang::Language;
pub use pipeline::Pipeline;

Modules

These types are not used for generating Indexes. They are provided to help with creating compatible JSON structures for configuring the JavaScript search function.
Implements an elasticlunr.js document store. Most users do not need to use this module directly.
Implements an elasticlunr.js inverted index. Most users do not need to use this module directly.
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.
Defines the pipeline which processes text for inclusion in the index. Most users do not need to use this module directly.

Structs

An elasticlunr search index.
A builder for an Index with custom parameters.

Constants

The version of elasticlunr.js this library was designed for.