(&mut self, key: KVPair, value: InvertedIndexItem, skip_compression: bool)
| 153 | } |
| 154 | |
| 155 | pub fn insert(&mut self, key: KVPair, value: InvertedIndexItem, skip_compression: bool) { |
| 156 | // println!("Inserting INTO INVERTED INDEX: {:?}", key); |
| 157 | if !skip_compression { |
| 158 | let compressed_indices = compress_indices(value.indices); |
| 159 | let value = InvertedIndexItem { |
| 160 | indices: compressed_indices, |
| 161 | ids: value.ids, |
| 162 | }; |
| 163 | self.tree.insert(key, value).expect("Failed to insert"); |
| 164 | } else { |
| 165 | self.tree.insert(key, value).expect("Failed to insert"); |
| 166 | } |
| 167 | // let compressed_indices = compress_indices(value.indices); |
| 168 | // let value = InvertedIndexItem { |
| 169 | // indices: compressed_indices, |
| 170 | // ids: value.ids, |
| 171 | // }; |
| 172 | // self.tree.insert(key, value).expect("Failed to insert"); |
| 173 | } |
| 174 | |
| 175 | pub fn get(&mut self, key: KVPair) -> Option<InvertedIndexItem> { |
| 176 | // println!("Getting key: {:?}", key); |
no test coverage detected