pull/4/merge
Ivan Zvonimir Horvat 3 years ago committed by GitHub
commit 2bf19da524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -21,6 +21,7 @@ fn tokenize(text: &str) -> Vec<&str> {
/// answer simple search queries. And you can use the `read`, `write`, and
/// `merge` modules to save an in-memory index to disk and merge it with other
/// indices, producing a large index.
#[derive(Default)]
pub struct InMemoryIndex {
/// The total number of words in the indexed documents.
pub word_count: usize,
@ -48,10 +49,7 @@ pub type Hit = Vec<u8>;
impl InMemoryIndex {
/// Create a new, empty index.
pub fn new() -> InMemoryIndex {
InMemoryIndex {
word_count: 0,
map: HashMap::new()
}
InMemoryIndex::default()
}
/// Index a single document.

Loading…
Cancel
Save