MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / fts_write_segment

Method fts_write_segment

nodedb/src/data/executor/core_loop/accessors.rs:175–186  ·  view source on GitHub ↗

Write a raw segment blob directly into the FTS LSM segment store for a given `(tenant, collection)`. This bypasses the memtable flush path and is intended for maintenance tests and bootstrapping code that need to pre-populate a known number of L0 segments without indexing documents. In production code, segments are written automatically when the FTS memtable crosses its flush threshold.

(
        &self,
        tenant: crate::types::TenantId,
        collection: &str,
        segment_id: &str,
        data: &[u8],
    )

Source from the content-addressed store, hash-verified

173 /// segments are written automatically when the FTS memtable crosses its
174 /// flush threshold.
175 pub fn fts_write_segment(
176 &self,
177 tenant: crate::types::TenantId,
178 collection: &str,
179 segment_id: &str,
180 data: &[u8],
181 ) -> crate::Result<()> {
182 use nodedb_fts::backend::FtsBackend;
183 self.inverted
184 .backend()
185 .write_segment(tenant.as_u64(), collection, segment_id, data)
186 }
187
188 /// Return the list of FTS LSM segment IDs for a `(tenant, collection)`.
189 ///

Callers 1

write_l0_segmentsFunction · 0.80

Calls 3

write_segmentMethod · 0.45
backendMethod · 0.45
as_u64Method · 0.45

Tested by 1

write_l0_segmentsFunction · 0.64