Lazily embed, don't fail hybrid search on embedding failure

This commit is contained in:
Louis Dureuil 2024-03-28 11:50:53 +01:00
parent fabc9cf14a
commit 6ebb6b55a6
No known key found for this signature in database
11 changed files with 237 additions and 203 deletions

View file

@ -1499,14 +1499,6 @@ impl Index {
.unwrap_or_default())
}
pub fn default_embedding_name(&self, rtxn: &RoTxn<'_>) -> Result<String> {
let configs = self.embedding_configs(rtxn)?;
Ok(match configs.as_slice() {
[(ref first_name, _)] => first_name.clone(),
_ => "default".to_owned(),
})
}
pub(crate) fn put_search_cutoff(&self, wtxn: &mut RwTxn<'_>, cutoff: u64) -> heed::Result<()> {
self.main.remap_types::<Str, BEU64>().put(wtxn, main_key::SEARCH_CUTOFF, &cutoff)
}