Method
write_postings
(
&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 |