MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / remove_kg_fts_entries

Method remove_kg_fts_entries

atomic-core/src/pristine/txn/write/triples.rs:115–133  ·  view source on GitHub ↗
(&mut self, node_id: &str)

Source from the content-addressed store, hash-verified

113 }
114
115 fn remove_kg_fts_entries(&mut self, node_id: &str) -> PristineResult<()> {
116 self.ensure_kg_fts_schema()?;
117
118 let tokens = {
119 let mut reverse = self.txn.open_multimap_table(KG_FTS_BY_NODE)?;
120 let removed = reverse.remove_all(node_id)?;
121 let mut tokens = Vec::new();
122 for token in removed {
123 tokens.push(token?.value().to_string());
124 }
125 tokens
126 };
127
128 let mut fts = self.txn.open_multimap_table(KG_FTS)?;
129 for token in tokens {
130 fts.remove(token.as_str(), node_id)?;
131 }
132 Ok(())
133 }
134
135 fn add_kg_fts_entries(&mut self, node_id: &str, text: &str) -> PristineResult<()> {
136 self.ensure_kg_fts_schema()?;

Callers 2

upsert_kg_nodeMethod · 0.80
del_kg_nodeMethod · 0.80

Calls 4

ensure_kg_fts_schemaMethod · 0.80
removeMethod · 0.65
pushMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected