2724: Make the document addition done log to appear once indexing is over r=curquiza a=evpeople

# Pull Request

## What does this PR do?
Fixes #2703 
<!-- Please link the issue you're trying to fix with this PR, if none then please create an issue first. -->

## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: evpeople <hangcaihui@gmail.com>
This commit is contained in:
bors[bot] 2022-08-31 13:13:36 +00:00 committed by GitHub
commit e315547ffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 367 additions and 318 deletions

670
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -331,14 +331,10 @@ impl Index {
builder = new_builder;
let user_result = match user_result {
Ok(count) => {
let addition = DocumentAdditionResult {
Ok(count) => Ok(DocumentAdditionResult {
indexed_documents: count,
number_of_documents: count,
};
info!("document addition done: {:?}", addition);
Ok(addition)
}
}),
Err(e) => Err(IndexError::from(e)),
};
@ -346,8 +342,9 @@ impl Index {
}
if results.iter().any(Result::is_ok) {
let _addition = builder.execute()?;
let addition = builder.execute()?;
txn.commit()?;
info!("document addition done: {:?}", addition);
}
Ok(results)