Section navigation

Public classSealed SegmentInfo

Namespace
Rowles.LeanCorpus.Index.Segment
Assembly
Rowles.LeanCorpus.dll

Metadata record for a single immutable segment.

public sealed class SegmentInfo
Inheritance
SegmentInfo

Public property CodecBytes

Gets segment bytes grouped by file extension.

Public property CommitGeneration

Gets the commit generation at which this segment was created.

Public property DelGeneration

The commit generation at which the current live-document file was written. When set, the file is named {SegmentId}gen{DelGeneration}.del. When null, the legacy {SegmentId}.del path is used for backward compatibility.

Public property DeletionDensity

Gets the fraction of documents currently deleted from this segment.

Public property DocCount

Gets the total number of documents in this segment, including deleted documents.

Public property EarliestSoftDeleteTimestamp

Gets the smallest soft-delete timestamp (Unix milliseconds) among live soft-deleted docs, or null if none exist.

Public property FieldNames

Gets the names of all indexed fields present in this segment.

Public property IndexSortFields

Serialised index sort fields for this segment. Null if the segment is unsorted. Each entry is "Type:FieldName:Descending" (e.g. "Numeric:price:True").

Public property IsCompoundFile

Gets a value indicating whether immutable codec files are stored in the segment's memory-mapped compound file. The segment metadata file, deletion files, and segment statistics remain separate.

Public property LiveDocCount

Gets the number of live (non-deleted) documents in this segment.

Public property MaxSequenceNumber

Inclusive upper bound of the sequence numbers assigned to documents in this segment. Only set when sequence number tracking is enabled.

Public property MinSequenceNumber

Inclusive lower bound of the sequence numbers assigned to documents in this segment. Only set when sequence number tracking is enabled.

Public property SegmentId

Gets the unique identifier for this segment (e.g. "seg_0").

Public property TotalBytes

Gets the total bytes occupied by this segment's files.

Public property VectorFields

Per-field vector metadata for vectors stored in this segment.

Public method ReadFrom(string)

Reads and deserialises segment metadata from the specified JSON file.

Public method WriteTo(string)

Writes this segment metadata to a JSON file at the specified path.