Files
tantivy/src/core/segment_component.rs
2017-02-19 22:38:15 +09:00

32 lines
969 B
Rust

#[derive(Copy, Clone)]
pub enum SegmentComponent {
INFO,
POSTINGS,
POSITIONS,
FASTFIELDS,
FIELDNORMS,
TERMS,
STORE,
DELETE(u64), //< The argument here is an opstamp.
// All of the deletes with an opstamp smaller or equal
// to this opstamp have been taken in account.
}
impl SegmentComponent {
pub fn path_suffix(&self)-> String {
match *self {
SegmentComponent::POSITIONS => ".pos".to_string(),
SegmentComponent::INFO => ".info".to_string(),
SegmentComponent::POSTINGS => ".idx".to_string(),
SegmentComponent::TERMS => ".term".to_string(),
SegmentComponent::STORE => ".store".to_string(),
SegmentComponent::FASTFIELDS => ".fast".to_string(),
SegmentComponent::FIELDNORMS => ".fieldnorm".to_string(),
SegmentComponent::DELETE(opstamp) => format!("{}.del", opstamp)
}
}
}