use nodedb_fts::backend::FtsBackend;
use nodedb_types::TenantId;
use super::core::InvertedIndex;
impl InvertedIndex {
pub fn corpus_stats(
&self,
database_id: u64,
tid: TenantId,
collection: &str,
) -> crate::Result<(u32, f32)> {
self.inner
.index_stats(database_id, tid.as_u64(), collection)
}
pub fn term_df(
&self,
database_id: u64,
tid: TenantId,
collection: &str,
term: &str,
) -> crate::Result<u32> {
let postings =
self.inner
.backend()
.read_postings(database_id, tid.as_u64(), collection, term)?;
Ok(postings.len() as u32)
}
}