README

Lucius646/MoonSearch/core does not have a README file

#
PersistenceError

pub(all) suberror PersistenceError {
Closed
NotFound(String)
InvalidName(String)
InvalidFormat(String)
Io(String)
} derive(Eq,
Debug
)

Failures raised while reading, validating, or publishing persisted index state.

#
DocAddress

pub(all) struct DocAddress {
segment_ord : Int
doc_id : DocId
} derive(Eq,
Debug
)

Address of a document in a searcher's segment set.

M1 searchers contain one segment, so segment_ord is always zero. Keeping the segment ordinal in the public result model avoids treating a segment-local DocId as a global identifier when multi-segment search is added later.

#
DocAddress::new

fn DocAddress::new(segment_ord : Int, doc_id : DocId) -> DocAddress

#
DocId

pub(all) struct DocId {
value : Int
} derive(Eq,
Debug
)

Segment-local document identifier.

#
DocId::new

fn DocId::new(value : Int) -> DocId

#
Document

pub struct Document {
field_ids : Array[FieldId]
texts : Array[String]
}

A document containing zero or more text fields.

#
Document::add_text

fn Document::add_text(self : Document, field_id : FieldId, text : String) -> Unit

Adds one text value to the document.

#
Document::field_count

fn Document::field_count(self : Document) -> Int

#
Document::field_id_at

fn Document::field_id_at(self : Document, index : Int) -> FieldId?

#
Document::new

fn Document::new() -> Document

#
Document::snapshot

fn Document::snapshot(self : Document) -> StoredDocument

#
Document::text_at

fn Document::text_at(self : Document, index : Int) -> String?

#
FieldId

pub(all) struct FieldId {
value : Int
} derive(Eq,
Debug
)

Stable identifier for a field within a MoonSearch schema.

M0 constructs field identifiers directly. A schema builder will own their allocation in a later milestone.

#
FieldId::new

fn FieldId::new(value : Int) -> FieldId

#
StoredDocument

pub struct StoredDocument {
field_ids : ReadOnlyArray[FieldId]
texts : ReadOnlyArray[String]
}

Immutable snapshot of the text values stored for one indexed document.

#
StoredDocument::from_fields

fn StoredDocument::from_fields(field_ids : Array[FieldId], texts : Array[String]) -> StoredDocument

#
StoredDocument::texts_for

fn StoredDocument::texts_for(self : StoredDocument, field_id : FieldId) -> ReadOnlyArray[String]

Returns every stored text value for a field in insertion order.

#
Term

pub(all) struct Term {
field_id : FieldId
text : String
} derive(Eq,
Debug
)

A field-qualified term. Equal text in different fields is a different term.

#
Term::new

fn Term::new(field_id : FieldId, text : String) -> Term

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io