mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Introduce synonyms deletions updates
This commit is contained in:
parent
0e224efa46
commit
ba32ce21d0
4 changed files with 199 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
use std::sync::Arc;
|
||||
use rkv::StoreError;
|
||||
use crate::error::MResult;
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
|
@ -18,6 +19,19 @@ impl Synonyms {
|
|||
self.synonyms.put(writer, word, &blob)
|
||||
}
|
||||
|
||||
pub fn del_synonyms(
|
||||
&self,
|
||||
writer: &mut rkv::Writer,
|
||||
word: &[u8],
|
||||
) -> Result<bool, rkv::StoreError>
|
||||
{
|
||||
match self.synonyms.delete(writer, word) {
|
||||
Ok(()) => Ok(true),
|
||||
Err(StoreError::LmdbError(lmdb::Error::NotFound)) => Ok(false),
|
||||
Err(e) => Err(e),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn synonyms(
|
||||
&self,
|
||||
reader: &impl rkv::Readable,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue