mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-07 01:32:53 +00:00
moved for the use of std::convert::From<Fst>
This commit is contained in:
@@ -10,7 +10,7 @@ byteorder = "0.4"
|
||||
memmap = "0.2"
|
||||
lazy_static = "0.1.*"
|
||||
regex = "0.1"
|
||||
fst = "0.1.27"
|
||||
fst = { path = "../fst" }
|
||||
rand = "0.3.13"
|
||||
atomicwrites = "0.0.14"
|
||||
tempfile = "2.0.0"
|
||||
|
||||
@@ -14,6 +14,12 @@ use core::postings::Postings;
|
||||
use core::simdcompression::Decoder;
|
||||
use std::io::Error as IOError;
|
||||
use std::io::ErrorKind;
|
||||
use std::io;
|
||||
|
||||
fn convert_fst_error(e: fst::Error) -> io::Error {
|
||||
io::Error::new(io::ErrorKind::Other, e)
|
||||
}
|
||||
|
||||
|
||||
// TODO file structure should be in codec
|
||||
|
||||
@@ -99,9 +105,9 @@ impl SegmentReader {
|
||||
|
||||
pub fn open(segment: Segment) -> Result<SegmentReader, IOError> {
|
||||
let term_shared_mmap = try!(segment.mmap(SegmentComponent::TERMS));
|
||||
let term_offsets = fst::Map::from_mmap(term_shared_mmap)
|
||||
.map_err(|e| IOError::new(ErrorKind::Other, e))
|
||||
.unwrap();
|
||||
let fst = try!(fst::raw::Fst::from_mmap(term_shared_mmap)
|
||||
.map_err(convert_fst_error));
|
||||
let term_offsets = fst::Map::from(fst);
|
||||
let store_reader = StoreReader::new(try!(segment.mmap(SegmentComponent::STORE)));
|
||||
let postings_shared_mmap = try!(segment.mmap(SegmentComponent::POSTINGS));
|
||||
Ok(SegmentReader {
|
||||
|
||||
Reference in New Issue
Block a user