diff --git a/Cargo.toml b/Cargo.toml index c9dc02143..75e7899b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,30 +17,30 @@ keywords = ["search", "information", "retrieval"] [dependencies] byteorder = "0.4" memmap = "0.2" -lazy_static = "0.1.15" +lazy_static = "0.1" regex = "0.1" -fst = "0.1.34" +fst = "0.1" atomicwrites = "0.0.14" -tempfile = "2.0.0" -rustc-serialize = "0.3.16" -log = "0.3.5" -combine = "1.3.0" -tempdir = "0.3.4" -bincode = "0.4.0" +tempfile = "2.0" +rustc-serialize = "0.3" +log = "0.3" +combine = "1.3" +tempdir = "0.3" +bincode = "0.4" libc = "0.2.6" num_cpus = "0.2" -itertools = "0.4.16" -lz4 = "1.13.131" -time = "0.1.34" +itertools = "0.4" +lz4 = "1.13" +time = "0.1" uuid = "0.1" -chan = "0.1.18" -crossbeam = "0.2.10" +chan = "0.1" +crossbeam = "0.2" [dev-dependencies] -rand = "0.3.13" +rand = "0.3" [build-dependencies] -gcc = "0.3.24" +gcc = "0.3" # [profile.release] # debug = true diff --git a/src/datastruct/stacker/heap.rs b/src/datastruct/stacker/heap.rs index ac5ee5bd8..18142e584 100644 --- a/src/datastruct/stacker/heap.rs +++ b/src/datastruct/stacker/heap.rs @@ -123,7 +123,7 @@ impl InnerHeap { } else { if self.next_heap.is_none() { - println!("exceed heap size"); + warn!("Exceeded heap size. The margin was apparently unsufficient. The segment will be committed right after indexing this very last document."); self.next_heap = Some(Box::new(InnerHeap::with_capacity(self.buffer_len as usize))); } self.next_heap.as_mut().unwrap().allocate(num_bytes) + self.buffer_len diff --git a/src/indexer/index_writer.rs b/src/indexer/index_writer.rs index 1cce1c5b1..e15f63bbb 100644 --- a/src/indexer/index_writer.rs +++ b/src/indexer/index_writer.rs @@ -51,8 +51,7 @@ fn index_documents(heap: &mut Heap, for doc in document_iterator { try!(segment_writer.add_document(&doc, &schema)); if segment_writer.is_buffer_full() { - println!("no more space committing."); - println!("seg max doc {}", segment_writer.max_doc()); + info!("Buffer limit reached, flushing segment with maxdoc={}.", segment_writer.max_doc()); break; } } diff --git a/src/lib.rs b/src/lib.rs index 2c0105a93..257897112 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,6 +15,9 @@ Tantivy is a search engine library. #[macro_use] extern crate lazy_static; +#[macro_use] +extern crate log; + #[macro_use] extern crate fst; extern crate byteorder; @@ -35,6 +38,8 @@ extern crate itertools; extern crate chan; extern crate crossbeam; + + #[cfg(test)] extern crate test; #[cfg(test)] extern crate rand;