diff --git a/benches/index-bench.rs b/benches/index-bench.rs index fe0c73963..c2a382bb2 100644 --- a/benches/index-bench.rs +++ b/benches/index-bench.rs @@ -1,7 +1,7 @@ use criterion::{criterion_group, criterion_main, Criterion, Throughput}; use pprof::criterion::{Output, PProfProfiler}; -use tantivy::schema::{FAST, INDEXED, STORED, STRING, TEXT}; -use tantivy::Index; +use tantivy::schema::{TantivyDocument, FAST, INDEXED, STORED, STRING, TEXT}; +use tantivy::{Index, IndexWriter}; const HDFS_LOGS: &str = include_str!("hdfs.json"); const GH_LOGS: &str = include_str!("gh.json"); @@ -41,7 +41,7 @@ pub fn hdfs_index_benchmark(c: &mut Criterion) { let index = Index::create_in_ram(schema.clone()); let index_writer: IndexWriter = index.writer_with_num_threads(1, 100_000_000).unwrap(); for doc_json in &lines { - let doc = Document::parse_json(&schema, doc_json).unwrap(); + let doc = TantivyDocument::parse_json(&schema, doc_json).unwrap(); index_writer.add_document(doc).unwrap(); } }) @@ -53,7 +53,7 @@ pub fn hdfs_index_benchmark(c: &mut Criterion) { let mut index_writer: IndexWriter = index.writer_with_num_threads(1, 100_000_000).unwrap(); for doc_json in &lines { - let doc = Document::parse_json(&schema, doc_json).unwrap(); + let doc = TantivyDocument::parse_json(&schema, doc_json).unwrap(); index_writer.add_document(doc).unwrap(); } index_writer.commit().unwrap(); @@ -65,7 +65,7 @@ pub fn hdfs_index_benchmark(c: &mut Criterion) { let index = Index::create_in_ram(schema_with_store.clone()); let index_writer: IndexWriter = index.writer_with_num_threads(1, 100_000_000).unwrap(); for doc_json in &lines { - let doc = Document::parse_json(&schema, doc_json).unwrap(); + let doc = TantivyDocument::parse_json(&schema, doc_json).unwrap(); index_writer.add_document(doc).unwrap(); } }) @@ -77,7 +77,7 @@ pub fn hdfs_index_benchmark(c: &mut Criterion) { let mut index_writer: IndexWriter = index.writer_with_num_threads(1, 100_000_000).unwrap(); for doc_json in &lines { - let doc = Document::parse_json(&schema, doc_json).unwrap(); + let doc = TantivyDocument::parse_json(&schema, doc_json).unwrap(); index_writer.add_document(doc).unwrap(); } index_writer.commit().unwrap(); diff --git a/src/lib.rs b/src/lib.rs index b24142205..fb05b2eb7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -186,7 +186,7 @@ pub use crate::indexer::{merge_filtered_segments, merge_indices, IndexWriter, Pr pub use crate::postings::Postings; #[allow(deprecated)] pub use crate::schema::DatePrecision; -pub use crate::schema::{DateOptions, DateTimePrecision, TantivyDocument, Term}; +pub use crate::schema::{DateOptions, DateTimePrecision, Document, TantivyDocument, Term}; /// Index format version. const INDEX_FORMAT_VERSION: u32 = 5;