README

Lucius646/MoonSearch/store does not have a README file

#
Directory

pub(open) trait Directory {
fn write(Self, String, Bytes) -> Unit raise
PersistenceError

fn read(Self, String) -> Bytes raise
PersistenceError

fn exists(Self, String) -> Bool
}

Minimal byte-oriented storage boundary for immutable index files.

#
DirectoryV2

pub(open) trait DirectoryV2 : Directory {
fn write_atomic(Self, String, Bytes) -> Unit raise
PersistenceError

fn sync(Self, String) -> Unit raise
PersistenceError

fn remove(Self, String) -> Unit raise
PersistenceError

fn list(Self) -> ReadOnlyArray[String] raise
PersistenceError

fn try_acquire_lock(Self, String) -> Int64? raise
PersistenceError

fn release_lock(Self, String, Int64) -> Unit raise
PersistenceError

fn capabilities(Self) -> DirectoryCapabilities
}

Durable index lifecycle operations layered on the byte-oriented Directory.

#
DirectoryCapabilities

pub(all) struct DirectoryCapabilities {
atomic_replace : Bool
durable_sync : Bool
exclusive_lock : Bool
read_only_mapping : Bool
} derive(Eq,
Debug
)

Storage guarantees exposed by a Directory v2 implementation.

#
FaultInjectingDirectory

pub struct FaultInjectingDirectory[D] {
inner : D
fail_at_operation : Int
operation_count : Int
}

Directory wrapper used to deterministically inject one mutation failure. It is useful for verifying that every commit boundary exposes only the old or the new generation.

#
FaultInjectingDirectory::new

fn[D] FaultInjectingDirectory::new(inner : D, fail_at_operation : Int) -> FaultInjectingDirectory[D]

#
FaultInjectingDirectory::operation_count

fn[D] FaultInjectingDirectory::operation_count(self : FaultInjectingDirectory[D]) -> Int

#
FsDirectory

pub struct FsDirectory {
root : String
}

Filesystem-backed Directory rooted at one directory.

#
IndexCheckReport

pub(all) struct IndexCheckReport {
generation : Int
segment_count : Int
live_document_count : Int
orphan_files : ReadOnlyArray[String]
temporary_files : ReadOnlyArray[String]
} derive(Eq,
Debug
)

Result of validating every manifest reference and Segment checksum.

#
IndexReader

pub struct IndexReader[D] {
directory : D
segments : ReadOnlyArray[
SnapshotSegment
]
schema_snapshot :
Schema
?
generation_snapshot : Int
closed : Bool
}

Immutable snapshot of the Segment set named by one manifest generation.

#
IndexReader::close

fn[D] IndexReader::close(self : IndexReader[D]) -> Unit

#
IndexReader::generation

#
IndexReader::open_if_changed

#
IndexReader::open_with_tokenizers

fn[D : Directory] IndexReader::open_with_tokenizers(directory : D, tokenizers :
TokenizerManager
) -> IndexReader[D] raise

Opens a reader and immediately verifies analyzer resource fingerprints persisted in its Schema. Use this entry point when fields pin dictionary or synonym revisions.

#
IndexReader::reload

Reloads this reader if the current manifest generation changed. Searchers created before reload remain immutable snapshots.

#
IndexReader::segment_count

#
IndexWriter

pub struct IndexWriter[D] {
directory : D
pending_delete_terms : Array[
Term
]
prepared_manifest_bytes : Bytes?
prepared_segment_name : String?
lock_token : Int64?
closed : Bool
}

Incremental writer that publishes one new immutable Segment per commit.

#
IndexWriter::close

fn[D : DirectoryV2 + Directory] IndexWriter::close(self : IndexWriter[D]) -> Unit

#
IndexWriter::commit

Convenience one-shot commit built on prepare_commit + commit_prepared.

#
IndexWriter::commit_deletes

#
IndexWriter::commit_prepared

Atomically publishes the previously prepared manifest.

#
IndexWriter::delete_term

Queues an exact field-qualified Term deletion for the next writer commit.

#
IndexWriter::garbage_collect

Removes orphan Segments and stale temporary files not referenced by the current manifest. Open readers are safe because they own decoded snapshots.

#
IndexWriter::is_prepared

fn[D] IndexWriter::is_prepared(self : IndexWriter[D]) -> Bool

#
IndexWriter::merge

Merges every live document into one new immutable Segment and publishes it as a new generation. Existing files remain available to older Readers.

#
IndexWriter::new

fn[D] IndexWriter::new(directory : D) -> IndexWriter[D]

#
IndexWriter::prepare_commit

Writes and syncs immutable data plus a private prepared manifest without changing the reader-visible manifest generation.

#
IndexWriter::prepare_deletes

Applies queued Term deletions to currently published Segments and publishes a new manifest generation. With no queued terms this is a no-op.

#
IndexWriter::rollback

Discards a prepared publication and queued deletes. Already published generations are never changed.

#
IndexWriter::update_document

Atomically replaces documents matching term with a pre-indexed Segment.

#
MemoryDirectory

pub struct MemoryDirectory {
names : Array[String]
contents : Array[Bytes]
locks : Array[String]
}

In-memory Directory implementation. Reads and writes copy bytes so a caller cannot mutate an already committed snapshot through an alias.

#
MemoryDirectory::new

#
MergePolicy

pub(all) struct MergePolicy {
max_segment_count : Int
} derive(Eq,
Debug
)

First deterministic merge policy: merge all segments once the configured segment-count threshold is reached.

#
MergePolicy::new

fn MergePolicy::new(max_segment_count : Int) -> MergePolicy

#
MergePolicy::should_merge

fn MergePolicy::should_merge(self : MergePolicy, segment_count : Int) -> Bool

#
MergeScheduler

pub(all) struct MergeScheduler {
policy : MergePolicy
max_input_bytes : Int
max_concurrent_merges : Int
in_flight_merges : Int
in_flight_bytes : Int
} derive(Eq,
Debug
)

Synchronous first scheduler with a hard per-merge input-byte budget. A non-positive budget disables throttling.

#
MergeScheduler::in_flight_bytes

fn MergeScheduler::in_flight_bytes(self : MergeScheduler) -> Int

#
MergeScheduler::in_flight_merges

fn MergeScheduler::in_flight_merges(self : MergeScheduler) -> Int

#
MergeScheduler::is_backpressured

fn MergeScheduler::is_backpressured(self : MergeScheduler, next_input_bytes : Int) -> Bool

#
MergeScheduler::new

fn MergeScheduler::new(policy : MergePolicy, max_input_bytes : Int) -> MergeScheduler

#
MergeScheduler::with_backpressure

fn MergeScheduler::with_backpressure(self : MergeScheduler, max_concurrent_merges : Int, max_in_flight_bytes : Int) -> MergeScheduler

Configures merge concurrency and aggregate in-flight bytes. A non-positive byte budget disables the aggregate byte limit.

#
MmapDirectory

pub struct MmapDirectory {
inner : FsDirectory
}

Read-only mapping facade. Native builds use durable FsDirectory primitives; portable targets retain the same immutable snapshot semantics.

#
check_index

Validates the current manifest, every referenced Segment, tombstones, checksums, and cross-Segment Schema compatibility. Orphans and temporary files are reported without making the otherwise valid snapshot unreadable.