mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 12:05:05 +08:00
plug the new batchers into the documents route
This commit is contained in:
parent
9be90011c6
commit
ba14ea1243
@ -8,7 +8,7 @@ use meilisearch_lib::milli::update::IndexDocumentsMethod;
|
||||
use meilisearch_lib::MeiliSearch;
|
||||
use once_cell::sync::Lazy;
|
||||
use serde::Deserialize;
|
||||
use serde_json::{json, Value};
|
||||
use serde_json::Value;
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
use crate::analytics::Analytics;
|
||||
@ -141,14 +141,10 @@ pub async fn add_documents(
|
||||
.map(|s| s.to_str().unwrap_or("unkown"));
|
||||
let params = params.into_inner();
|
||||
|
||||
analytics.publish(
|
||||
"Documents Added".to_string(),
|
||||
json!({
|
||||
"payload_type": content_type,
|
||||
"with_primary_key": params.primary_key,
|
||||
"index_creation": meilisearch.get_index(path.index_uid.clone()).await.is_ok(),
|
||||
}),
|
||||
Some(&req),
|
||||
analytics.add_documents(
|
||||
¶ms,
|
||||
meilisearch.get_index(path.index_uid.clone()).await.is_ok(),
|
||||
&req,
|
||||
);
|
||||
|
||||
document_addition(
|
||||
@ -176,14 +172,10 @@ pub async fn update_documents(
|
||||
.get("Content-type")
|
||||
.map(|s| s.to_str().unwrap_or("unkown"));
|
||||
|
||||
analytics.publish(
|
||||
"Documents Updated".to_string(),
|
||||
json!({
|
||||
"payload_type": content_type,
|
||||
"with_primary_key": params.primary_key,
|
||||
"index_creation": meilisearch.get_index(path.index_uid.clone()).await.is_ok(),
|
||||
}),
|
||||
Some(&req),
|
||||
analytics.update_documents(
|
||||
¶ms,
|
||||
meilisearch.get_index(path.index_uid.clone()).await.is_ok(),
|
||||
&req,
|
||||
);
|
||||
|
||||
document_addition(
|
||||
|
Loading…
Reference in New Issue
Block a user