MCPcopy Create free account
hub / github.com/carsonpo/haystackdb / get

Method get

src/structures/inverted_index.rs:175–194  ·  view source on GitHub ↗
(&mut self, key: KVPair)

Source from the content-addressed store, hash-verified

173 }
174
175 pub fn get(&mut self, key: KVPair) -> Option<InvertedIndexItem> {
176 // println!("Getting key: {:?}", key);
177 match self.tree.search(key) {
178 Ok(v) => {
179 // decompress the indices
180 match v {
181 Some(mut item) => {
182 println!("Search result: {:?}", item); // Add this
183
184 item.indices = decompress_indices(item.indices);
185 println!("Decompressed indices: {:?}", item.indices); // Check output
186
187 Some(item)
188 }
189 None => None,
190 }
191 }
192 Err(_) => None,
193 }
194 }
195
196 pub fn insert_append(&mut self, key: KVPair, mut value: InvertedIndexItem) {
197 match self.get(key.clone()) {

Callers 1

insert_appendMethod · 0.45

Calls 2

decompress_indicesFunction · 0.85
searchMethod · 0.45

Tested by

no test coverage detected