Crate elasticlunr [] [src]

elasticlunr-rs

Build Status Documentation Crates.io

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

Usage

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());

Structs

Index

An elasticlunr search index.

IndexBuilder

A builder for an Index with custom parameters.

Constants

ELASTICLUNR_VERSION

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