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

Method index_document_in_txn

nodedb/src/engine/sparse/inverted/indexing.rs:45–58  ·  view source on GitHub ↗

Index a document within an externally-owned write transaction.

(
        &self,
        txn: &WriteTransaction,
        tid: TenantId,
        collection: &str,
        surrogate: Surrogate,
        text: &str,
    )

Source from the content-addressed store, hash-verified

43
44 /// Index a document within an externally-owned write transaction.
45 pub fn index_document_in_txn(
46 &self,
47 txn: &WriteTransaction,
48 tid: TenantId,
49 collection: &str,
50 surrogate: Surrogate,
51 text: &str,
52 ) -> crate::Result<()> {
53 let tokens = nodedb_fts::analyze(text);
54 if tokens.is_empty() {
55 return Ok(());
56 }
57 self.write_index_data(txn, tid, collection, surrogate, &tokens)
58 }
59
60 /// Core indexing logic: writes postings, doc length, and stats within
61 /// a transaction. Bypasses the LSM memtable so Origin transactions can

Callers 1

apply_point_putMethod · 0.80

Calls 3

write_index_dataMethod · 0.80
analyzeFunction · 0.50
is_emptyMethod · 0.45

Tested by

no test coverage detected