README

Lucius646/MoonSearch/index does not have a README file

#
FieldLength

type FieldLength

#
FieldStats

type FieldStats

#
Posting

pub(all) struct Posting {
doc_id :
DocId

term_freq : Int
positions : ReadOnlyArray[Int]
} derive(Eq,
Debug
)

One document occurrence in a posting list.

#
Segment

pub struct Segment {
schema :
Schema
?
indexed_terms : ReadOnlyArray[
Term
]
posting_lists : ReadOnlyArray[ReadOnlyArray[Posting]]
stored_documents : ReadOnlyArray[
StoredDocument
]
document_field_lengths : ReadOnlyArray[ReadOnlyArray[FieldLength]]
field_stats : ReadOnlyArray[FieldStats]
document_count : Int
}

Immutable in-memory index for one batch of documents.

#
Segment::average_field_length

fn Segment::average_field_length(self : Segment, field_id :
FieldId
) -> Double

Average analyzed token count among documents that contain the field.

#
Segment::doc

Returns the immutable stored document for a segment-local document ID.

#
Segment::doc_count

fn Segment::doc_count(self : Segment) -> Int

#
Segment::field_doc_count

fn Segment::field_doc_count(self : Segment, field_id :
FieldId
) -> Int

Number of documents that contain the field, including empty field values.

#
Segment::field_length

Returns the analyzed token count for one document field.

#
Segment::has_field

#
Segment::postings_for

fn Segment::postings_for(self : Segment, term :
Term
) -> ReadOnlyArray[Posting]

Looks up a field-qualified term in this segment.

#
Segment::schema

Returns the schema used by this segment, if it was built with one.

#
Segment::terms

fn Segment::terms(self : Segment) -> ReadOnlyArray[
Term
]

Returns all indexed terms in deterministic first-seen order.

#
SegmentWriter

pub struct SegmentWriter[A] {
tokenizer : A
tokenizer_manager :
TokenizerManager
?
schema :
Schema
?
terms : Array[
Term
]
posting_doc_ids : Array[Array[
DocId
]]
posting_term_freqs : Array[Array[Int]]
posting_positions : Array[Array[Array[Int]]]
stored_documents : Array[
StoredDocument
]
document_field_lengths : Array[Array[FieldLength]]
field_stats : Array[FieldStats]
next_doc_id : Int
}

Mutable builder for one in-memory segment.

#
SegmentWriter::add_document

Adds a document and returns its sequential segment-local identifier.

#
SegmentWriter::finish

fn[A] SegmentWriter::finish(self : SegmentWriter[A]) -> Segment

Finishes the current batch as an immutable in-memory segment.

#
SegmentWriter::new

fn[A] SegmentWriter::new(tokenizer : A) -> SegmentWriter[A]

#
SegmentWriter::with_schema

fn[A] SegmentWriter::with_schema(schema :
Schema
, tokenizer : A) -> SegmentWriter[A]

Creates a writer that applies the schema's indexed and stored text options.

#
SegmentWriter::with_schema_and_tokenizers

Creates a schema-aware writer that resolves each indexed field's Tokenizer pipeline through the supplied TokenizerManager before accepting documents.

#
SnapshotSegment

pub struct SnapshotSegment {
segment : Segment
deleted_docs : ReadOnlyArray[
DocId
]
}

One immutable Segment together with the tombstones captured by a manifest generation.

#
SnapshotSegment::is_deleted

#
SnapshotSegment::live_doc_count

fn SnapshotSegment::live_doc_count(self : SnapshotSegment) -> Int

#
SnapshotSegment::new

fn SnapshotSegment::new(segment : Segment, deleted_docs : ReadOnlyArray[
DocId
]) -> SnapshotSegment

#
decode_segment

Decodes and validates one immutable M3 Segment container.

#
encode_segment

fn encode_segment(segment : Segment) -> Bytes

#
live_snapshot

fn live_snapshot(segment : Segment) -> SnapshotSegment

#
merge_snapshot_segments

fn merge_snapshot_segments(snapshots : ReadOnlyArray[SnapshotSegment]) -> Segment

Combines live documents by copying immutable index structures and assigning consecutive DocIds in Segment order. No field is re-analyzed.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io