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

Method write_postings

nodedb-fts/src/backend/memory.rs:89–104  ·  view source on GitHub ↗
(
        &self,
        tid: u64,
        collection: &str,
        term: &str,
        postings: &[Posting],
    )

Source from the content-addressed store, hash-verified

87 }
88
89 fn write_postings(
90 &self,
91 tid: u64,
92 collection: &str,
93 term: &str,
94 postings: &[Posting],
95 ) -> Result<(), Self::Error> {
96 let key = triple(tid, collection, term);
97 let mut map = self.postings.borrow_mut();
98 if postings.is_empty() {
99 map.remove(&key);
100 } else {
101 map.insert(key, postings.to_vec());
102 }
103 Ok(())
104 }
105
106 fn remove_postings(&self, tid: u64, collection: &str, term: &str) -> Result<(), Self::Error> {
107 self.postings

Callers 4

roundtrip_postingsFunction · 0.45
collection_termsFunction · 0.45

Calls 5

tripleFunction · 0.85
is_emptyMethod · 0.45
removeMethod · 0.45
insertMethod · 0.45
to_vecMethod · 0.45

Tested by 4

roundtrip_postingsFunction · 0.36
collection_termsFunction · 0.36