mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-05 20:26:31 +00:00
Rename HannoyStats to VectorStoreStats
The stats can be provided by any backend
This commit is contained in:
@ -143,10 +143,10 @@ impl IndexStats {
|
||||
///
|
||||
/// - rtxn: a RO transaction for the index, obtained from `Index::read_txn()`.
|
||||
pub fn new(index: &Index, rtxn: &RoTxn) -> milli::Result<Self> {
|
||||
let hannoy_stats = index.hannoy_stats(rtxn)?;
|
||||
let vector_store_stats = index.vector_store_stats(rtxn)?;
|
||||
Ok(IndexStats {
|
||||
number_of_embeddings: Some(hannoy_stats.number_of_embeddings),
|
||||
number_of_embedded_documents: Some(hannoy_stats.documents.len()),
|
||||
number_of_embeddings: Some(vector_store_stats.number_of_embeddings),
|
||||
number_of_embedded_documents: Some(vector_store_stats.documents.len()),
|
||||
documents_database_stats: index.documents_stats(rtxn)?.unwrap_or_default(),
|
||||
number_of_documents: None,
|
||||
database_size: index.on_disk_size()?,
|
||||
|
@ -31,7 +31,7 @@ use crate::prompt::PromptData;
|
||||
use crate::proximity::ProximityPrecision;
|
||||
use crate::update::new::StdResult;
|
||||
use crate::vector::db::IndexEmbeddingConfigs;
|
||||
use crate::vector::{Embedding, HannoyStats, VectorStore, VectorStoreBackend};
|
||||
use crate::vector::{Embedding, VectorStore, VectorStoreBackend, VectorStoreStats};
|
||||
use crate::{
|
||||
default_criteria, CboRoaringBitmapCodec, Criterion, DocumentId, ExternalDocumentsIds,
|
||||
FacetDistribution, FieldDistribution, FieldId, FieldIdMapMissingEntry, FieldIdWordCountCodec,
|
||||
@ -1825,8 +1825,8 @@ impl Index {
|
||||
Ok(PrefixSettings { compute_prefixes, max_prefix_length: 4, prefix_count_threshold: 100 })
|
||||
}
|
||||
|
||||
pub fn hannoy_stats(&self, rtxn: &RoTxn<'_>) -> Result<HannoyStats> {
|
||||
let mut stats = HannoyStats::default();
|
||||
pub fn vector_store_stats(&self, rtxn: &RoTxn<'_>) -> Result<VectorStoreStats> {
|
||||
let mut stats = VectorStoreStats::default();
|
||||
let embedding_configs = self.embedding_configs();
|
||||
let backend = self.get_vector_store(rtxn)?;
|
||||
|
||||
|
@ -3,7 +3,7 @@ use roaring::{MultiOps, RoaringBitmap};
|
||||
|
||||
use crate::error::{DidYouMean, Error};
|
||||
use crate::vector::db::IndexEmbeddingConfig;
|
||||
use crate::vector::{HannoyStats, VectorStore};
|
||||
use crate::vector::{VectorStoreStats, VectorStore};
|
||||
use crate::Index;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
@ -134,7 +134,7 @@ fn evaluate_inner(
|
||||
}
|
||||
|
||||
let user_provided_docids = embedder_info.embedding_status.user_provided_docids();
|
||||
let mut stats = HannoyStats::default();
|
||||
let mut stats = VectorStoreStats::default();
|
||||
vector_store.aggregate_stats(rtxn, &mut stats)?;
|
||||
stats.documents - user_provided_docids.clone()
|
||||
}
|
||||
@ -143,13 +143,13 @@ fn evaluate_inner(
|
||||
user_provided_docids.clone()
|
||||
}
|
||||
VectorFilter::Regenerate => {
|
||||
let mut stats = HannoyStats::default();
|
||||
let mut stats = VectorStoreStats::default();
|
||||
vector_store.aggregate_stats(rtxn, &mut stats)?;
|
||||
let skip_regenerate = embedder_info.embedding_status.skip_regenerate_docids();
|
||||
stats.documents - skip_regenerate
|
||||
}
|
||||
VectorFilter::None => {
|
||||
let mut stats = HannoyStats::default();
|
||||
let mut stats = VectorStoreStats::default();
|
||||
vector_store.aggregate_stats(rtxn, &mut stats)?;
|
||||
stats.documents
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ pub use distribution::DistributionShift;
|
||||
pub use embedder::{Embedder, EmbedderOptions, EmbeddingConfig, SearchQuery};
|
||||
pub use embeddings::Embeddings;
|
||||
pub use runtime::{RuntimeEmbedder, RuntimeEmbedders, RuntimeFragment};
|
||||
pub use store::{HannoyStats, VectorStore, VectorStoreBackend};
|
||||
pub use store::{VectorStore, VectorStoreBackend, VectorStoreStats};
|
||||
|
||||
pub const REQUEST_PARALLELISM: usize = 40;
|
||||
|
||||
|
@ -645,7 +645,7 @@ impl VectorStore {
|
||||
pub fn aggregate_stats(
|
||||
&self,
|
||||
rtxn: &RoTxn,
|
||||
stats: &mut HannoyStats,
|
||||
stats: &mut VectorStoreStats,
|
||||
) -> Result<(), crate::Error> {
|
||||
if self.backend == VectorStoreBackend::Arroy {
|
||||
if self.quantized {
|
||||
@ -1161,7 +1161,7 @@ where
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct HannoyStats {
|
||||
pub struct VectorStoreStats {
|
||||
pub number_of_embeddings: u64,
|
||||
pub documents: RoaringBitmap,
|
||||
}
|
||||
|
Reference in New Issue
Block a user