Skip to main content

Module format

Module format 

Source
Expand description

Segment binary format: header, component offsets, field metadata.

A segment is a self-contained unit holding all index structures for a set of documents. The format starts with a fixed header followed by component data:

[magic: 4 bytes "MSEG"]
[segment_id: u64]
[doc_count: u32]
[max_doc: u32]
[header_checksum: u64]
[num_components: u8]
[ComponentOffset * num_components]
[num_fields: u16]
[FieldMeta * num_fields]
... component data ...

See [[architecture-segment-layout]] and [[architecture-overview#Step 5]].

Structs§

ComponentOffset
Location and checksum of a component within the segment.
FieldMeta
Per-field metadata stored in the segment header.
SegmentHeader
The segment header: fixed fields + component offsets + field metadata.

Enums§

ComponentType
Component types stored in a segment.

Constants§

FLAG_DOC_VALUES
FLAG_INDEXED
FLAG_NORMS
FLAG_STORED
Field flags packed into a single byte.
SEGMENT_MAGIC
Magic bytes at the start of every segment.