Struct elasticlunr::Index [] [src]

pub struct Index {
    pub fields: Vec<String>,
    pub pipeline: Pipeline,
    pub ref_field: String,
    pub version: &'static str,
    pub document_store: DocumentStore,
    // some fields omitted
}

An elasticlunr search index.

Fields

Methods

impl Index
[src]

[src]

Create a new index with the provided fields.

Example

let mut index = Index::new(&["title", "body", "breadcrumbs"]);
index.add_doc("1", &["How to Foo", "First, you need to `bar`.", "Chapter 1 > How to Foo"]);

[src]

Create a new index with the provided fields for the given Language.

Example

let mut index = Index::with_language(Language::English, &["title", "body"]);
index.add_doc("1", &["this is a title", "this is body text"]);

[src]

Add the data from a document to the index.

NOTE: The elements of data should be provided in the same order as the fields used to create the index.

Example

let mut index = Index::new(&["title", "body"]);
index.add_doc("1", &["this is a title", "this is body text"]);

[src]

[src]

Returns the index, serialized to pretty-printed JSON.

[src]

Returns the index, serialized to JSON.

Trait Implementations

impl Debug for Index
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Index

impl Sync for Index