mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-02-24 03:25:43 +08:00
wip
This commit is contained in:
parent
5dc7a8faa7
commit
febc93b546
@ -12,7 +12,7 @@ use milli::documents::mmap_from_objects;
|
|||||||
use milli::heed::EnvOpenOptions;
|
use milli::heed::EnvOpenOptions;
|
||||||
use milli::progress::Progress;
|
use milli::progress::Progress;
|
||||||
use milli::update::new::indexer;
|
use milli::update::new::indexer;
|
||||||
use milli::update::{IndexDocumentsMethod, IndexerConfig};
|
use milli::update::IndexerConfig;
|
||||||
use milli::vector::EmbeddingConfigs;
|
use milli::vector::EmbeddingConfigs;
|
||||||
use milli::Index;
|
use milli::Index;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
@ -1839,9 +1839,15 @@ pub(crate) mod tests {
|
|||||||
|
|
||||||
let embedders =
|
let embedders =
|
||||||
InnerIndexSettings::from_index(&self.inner, &rtxn, None)?.embedding_configs;
|
InnerIndexSettings::from_index(&self.inner, &rtxn, None)?.embedding_configs;
|
||||||
let mut indexer =
|
let mut indexer = indexer::DocumentOperation::new();
|
||||||
indexer::DocumentOperation::new(self.index_documents_config.update_method);
|
match self.index_documents_config.update_method {
|
||||||
indexer.add_documents(&documents).unwrap();
|
IndexDocumentsMethod::ReplaceDocuments => {
|
||||||
|
indexer.replace_documents(&documents).unwrap()
|
||||||
|
}
|
||||||
|
IndexDocumentsMethod::UpdateDocuments => {
|
||||||
|
indexer.update_documents(&documents).unwrap()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let indexer_alloc = Bump::new();
|
let indexer_alloc = Bump::new();
|
||||||
let (document_changes, operation_stats, primary_key) = indexer.into_changes(
|
let (document_changes, operation_stats, primary_key) = indexer.into_changes(
|
||||||
@ -1928,8 +1934,7 @@ pub(crate) mod tests {
|
|||||||
let embedders =
|
let embedders =
|
||||||
InnerIndexSettings::from_index(&self.inner, &rtxn, None)?.embedding_configs;
|
InnerIndexSettings::from_index(&self.inner, &rtxn, None)?.embedding_configs;
|
||||||
|
|
||||||
let mut indexer =
|
let mut indexer = indexer::DocumentOperation::new();
|
||||||
indexer::DocumentOperation::new(self.index_documents_config.update_method);
|
|
||||||
let external_document_ids: Vec<_> =
|
let external_document_ids: Vec<_> =
|
||||||
external_document_ids.iter().map(AsRef::as_ref).collect();
|
external_document_ids.iter().map(AsRef::as_ref).collect();
|
||||||
indexer.delete_documents(external_document_ids.as_slice());
|
indexer.delete_documents(external_document_ids.as_slice());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user