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

Method insert

nodedb-fts/src/lsm/memtable.rs:74–78  ·  view source on GitHub ↗

Insert a posting for a term. Surrogate is supplied by the caller.

(&self, term: &str, posting: CompactPosting)

Source from the content-addressed store, hash-verified

72
73 /// Insert a posting for a term. Surrogate is supplied by the caller.
74 pub fn insert(&self, term: &str, posting: CompactPosting) {
75 let mut map = self.postings.borrow_mut();
76 map.entry(term.to_string()).or_default().push(posting);
77 *self.total_postings.borrow_mut() += 1;
78 }
79
80 /// Record a document's stats (call once per indexed document).
81 pub fn record_doc(&self, doc_id: Surrogate, doc_len: u32) {

Callers 15

addMethod · 0.45
set_analyzerMethod · 0.45
write_postingsMethod · 0.45
write_doc_lengthMethod · 0.45
write_metaMethod · 0.45
write_segmentMethod · 0.45
merge_segmentsFunction · 0.45
dedup_postingsFunction · 0.45
merge_two_segmentsFunction · 0.45
insert_and_queryFunction · 0.45
remove_docFunction · 0.45
drain_resets_everythingFunction · 0.45

Calls 3

entryMethod · 0.80
to_stringMethod · 0.80
pushMethod · 0.45

Tested by 11

merge_two_segmentsFunction · 0.36
insert_and_queryFunction · 0.36
remove_docFunction · 0.36
drain_resets_everythingFunction · 0.36
spill_thresholdFunction · 0.36
memtable_onlyFunction · 0.36
segment_onlyFunction · 0.36