mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-05-28 06:00:40 +00:00
Fmt fix
This commit is contained in:
@@ -14,11 +14,11 @@ pub enum SegmentComponent {
|
||||
/// Stores the sum of the length (in terms) of each field for each document.
|
||||
/// Field norms are stored as a special u64 fast field.
|
||||
FIELDNORMS,
|
||||
/// Dictionary associating `Term`s to `TermInfo`s which is
|
||||
/// Dictionary associating `Term`s to `TermInfo`s which is
|
||||
/// simply an address into the `postings` file and the `positions` file.
|
||||
TERMS,
|
||||
/// Row-oriented, LZ4-compressed storage of the documents.
|
||||
/// Accessing a document from the store is relatively slow, as it
|
||||
/// Accessing a document from the store is relatively slow, as it
|
||||
/// requires to decompress the entire block it belongs to.
|
||||
STORE,
|
||||
/// Bitset describing which document of the segment is deleted.
|
||||
@@ -26,7 +26,6 @@ pub enum SegmentComponent {
|
||||
}
|
||||
|
||||
impl SegmentComponent {
|
||||
|
||||
/// Iterates through the components.
|
||||
pub fn iterator() -> impl Iterator<Item = &'static SegmentComponent> {
|
||||
static SEGMENT_COMPONENTS: [SegmentComponent; 7] = [SegmentComponent::POSTINGS,
|
||||
|
||||
@@ -248,4 +248,4 @@ impl FastFieldsReader {
|
||||
unsafe impl Send for U64FastFieldReader {}
|
||||
unsafe impl Sync for U64FastFieldReader {}
|
||||
unsafe impl Send for I64FastFieldReader {}
|
||||
unsafe impl Sync for I64FastFieldReader {}
|
||||
unsafe impl Sync for I64FastFieldReader {}
|
||||
|
||||
@@ -350,7 +350,8 @@ impl IndexWriter {
|
||||
pub fn add_segment(&mut self, segment_meta: SegmentMeta) {
|
||||
let delete_cursor = self.delete_queue.cursor();
|
||||
let segment_entry = SegmentEntry::new(segment_meta, delete_cursor, None);
|
||||
self.segment_updater.add_segment(self.generation, segment_entry);
|
||||
self.segment_updater
|
||||
.add_segment(self.generation, segment_entry);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
/*!
|
||||
Tantivy's store is a compressed, row-oriented storage.
|
||||
|
||||
A field needs to be marked as stored in the schema in
|
||||
A field needs to be marked as stored in the schema in
|
||||
order to be handled in the `Store`.
|
||||
|
||||
Internally, documents (or rather their stored fields) are serialized to a buffer.
|
||||
When the buffer exceeds 16K, the buffer is compressed using `LZ4`
|
||||
and the resulting block is written to disk.
|
||||
|
||||
One can then request for a specific `DocId`.
|
||||
One can then request for a specific `DocId`.
|
||||
A skip list helps navigating to the right block,
|
||||
decompresses it entirely and returns the document within it.
|
||||
|
||||
If the last document requested was in the same block,
|
||||
the reader is smart enough to avoid decompressing
|
||||
the block a second time, but their is no real
|
||||
the reader is smart enough to avoid decompressing
|
||||
the block a second time, but their is no real
|
||||
*uncompressed block* cache.
|
||||
|
||||
A typical use case for the store is, once
|
||||
@@ -26,8 +26,10 @@ the actual content of the 10 best document.
|
||||
Most users should not access the `StoreReader` directly
|
||||
and should rely on either
|
||||
|
||||
- at the segment level, the [`SegmentReader`'s `doc` method](../struct.SegmentReader.html#method.doc)
|
||||
- at the index level, the [`Searcher`'s `doc` method](../struct.Searcher.html#method.doc)
|
||||
- at the segment level, the
|
||||
[`SegmentReader`'s `doc` method](../struct.SegmentReader.html#method.doc)
|
||||
- at the index level, the
|
||||
[`Searcher`'s `doc` method](../struct.Searcher.html#method.doc)
|
||||
|
||||
!*/
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ pub struct StoreReader {
|
||||
}
|
||||
|
||||
impl StoreReader {
|
||||
|
||||
/// Opens a store reader
|
||||
pub fn from_source(data: ReadOnlySource) -> StoreReader {
|
||||
let (data_source, offset_index_source, max_doc) = split_source(data);
|
||||
|
||||
@@ -12,7 +12,7 @@ const BLOCK_SIZE: usize = 16_384;
|
||||
/// Write tantivy's [`Store`](./index.html)
|
||||
///
|
||||
/// Contrary to the other components of `tantivy`,
|
||||
/// the store is written to disc as document as being added,
|
||||
/// the store is written to disc as document as being added,
|
||||
/// as opposed to when the segment is getting finalized.
|
||||
///
|
||||
/// The skip list index on the other hand, is build in memory.
|
||||
@@ -28,7 +28,6 @@ pub struct StoreWriter {
|
||||
|
||||
|
||||
impl StoreWriter {
|
||||
|
||||
/// Create a store writer.
|
||||
///
|
||||
/// The store writer will writes blocks on disc as
|
||||
@@ -45,7 +44,7 @@ impl StoreWriter {
|
||||
}
|
||||
|
||||
/// Store a new document.
|
||||
///
|
||||
///
|
||||
/// The document id is implicitely the number of times
|
||||
/// this method has been called.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user