mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
Count exported documents by index name, not pattern
This commit is contained in:
parent
9cfbef478e
commit
259fc067d3
2 changed files with 11 additions and 12 deletions
|
@ -30,7 +30,7 @@ impl IndexScheduler {
|
|||
payload_size: Option<&Byte>,
|
||||
indexes: &BTreeMap<IndexUidPattern, ExportIndexSettings>,
|
||||
progress: Progress,
|
||||
) -> Result<BTreeMap<IndexUidPattern, DetailsExportIndexSettings>> {
|
||||
) -> Result<BTreeMap<String, DetailsExportIndexSettings>> {
|
||||
#[cfg(test)]
|
||||
self.maybe_fail(crate::test_utils::FailureLocation::ProcessExport)?;
|
||||
|
||||
|
@ -48,7 +48,7 @@ impl IndexScheduler {
|
|||
let mut output = BTreeMap::new();
|
||||
let agent = ureq::AgentBuilder::new().timeout(Duration::from_secs(5)).build();
|
||||
let must_stop_processing = self.scheduler.must_stop_processing.clone();
|
||||
for (i, (pattern, uid, export_settings)) in indexes.iter().enumerate() {
|
||||
for (i, (_pattern, uid, export_settings)) in indexes.iter().enumerate() {
|
||||
if must_stop_processing.get() {
|
||||
return Err(Error::AbortedTask);
|
||||
}
|
||||
|
@ -63,9 +63,8 @@ impl IndexScheduler {
|
|||
let index = self.index(uid)?;
|
||||
let index_rtxn = index.read_txn()?;
|
||||
|
||||
let url = format!("{base_url}/indexes/{uid}");
|
||||
|
||||
// First, check if the index already exists
|
||||
let url = format!("{base_url}/indexes/{uid}");
|
||||
let response = retry(&must_stop_processing, || {
|
||||
let mut request = agent.get(&url);
|
||||
if let Some(api_key) = api_key {
|
||||
|
@ -158,7 +157,7 @@ impl IndexScheduler {
|
|||
progress.update_progress(progress_step);
|
||||
|
||||
output.insert(
|
||||
(*pattern).clone(),
|
||||
uid.clone(),
|
||||
DetailsExportIndexSettings {
|
||||
settings: (*export_settings).clone(),
|
||||
matched_documents: Some(total_documents as u64),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue