Uncommenting unit test

This commit is contained in:
Paul Masurel
2017-05-18 20:41:56 +09:00
parent e79a316e41
commit ca76fd5ba0
3 changed files with 78 additions and 83 deletions

View File

@@ -7,7 +7,9 @@ use query::Query;
use DocId;
use DocAddress;
use schema::Term;
use datastruct::fstmap::FstMerger;
use std::fmt;
use postings::TermInfo;
/// Holds a list of `SegmentReader`s ready for search.
@@ -62,6 +64,18 @@ impl Searcher {
pub fn search<C: Collector>(&self, query: &Query, collector: &mut C) -> Result<TimerTree> {
query.search(self, collector)
}
/// Returns a Stream over all of the sorted unique terms of
/// the searcher.
///
/// This includes all of the fields from all of the segment_readers.
/// See [TermIterator](struct.TermIterator.html).
///
/// # Warning
/// This API is very likely to change in the future.
pub fn terms(&self) -> FstMerger<TermInfo> {
FstMerger::from(self.segment_readers())
}
}

View File

@@ -171,7 +171,7 @@ impl SegmentReader {
}
/// Return the term dictionary datastructure.
pub fn term_infos<'b>(&'b self) -> &'b FstMap<TermInfo> {
pub fn term_infos(&self) -> &FstMap<TermInfo> {
&self.term_infos
}
@@ -227,11 +227,6 @@ impl SegmentReader {
_ => { SegmentPostingsOption::NoFreq },
};
Some(self.read_postings_from_terminfo(&term_info, possible_option))
// SegmentPostings::from_data(term_info.doc_freq,
// postings_data,
// &self.delete_bitset,
// freq_handler))
}
pub fn read_postings_from_terminfo(&self,