mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 00:55:00 +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 meilisearch_lib::MeiliSearch;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use serde_json::{json, Value};
|
use serde_json::Value;
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
|
|
||||||
use crate::analytics::Analytics;
|
use crate::analytics::Analytics;
|
||||||
@ -141,14 +141,10 @@ pub async fn add_documents(
|
|||||||
.map(|s| s.to_str().unwrap_or("unkown"));
|
.map(|s| s.to_str().unwrap_or("unkown"));
|
||||||
let params = params.into_inner();
|
let params = params.into_inner();
|
||||||
|
|
||||||
analytics.publish(
|
analytics.add_documents(
|
||||||
"Documents Added".to_string(),
|
¶ms,
|
||||||
json!({
|
meilisearch.get_index(path.index_uid.clone()).await.is_ok(),
|
||||||
"payload_type": content_type,
|
&req,
|
||||||
"with_primary_key": params.primary_key,
|
|
||||||
"index_creation": meilisearch.get_index(path.index_uid.clone()).await.is_ok(),
|
|
||||||
}),
|
|
||||||
Some(&req),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
document_addition(
|
document_addition(
|
||||||
@ -176,14 +172,10 @@ pub async fn update_documents(
|
|||||||
.get("Content-type")
|
.get("Content-type")
|
||||||
.map(|s| s.to_str().unwrap_or("unkown"));
|
.map(|s| s.to_str().unwrap_or("unkown"));
|
||||||
|
|
||||||
analytics.publish(
|
analytics.update_documents(
|
||||||
"Documents Updated".to_string(),
|
¶ms,
|
||||||
json!({
|
meilisearch.get_index(path.index_uid.clone()).await.is_ok(),
|
||||||
"payload_type": content_type,
|
&req,
|
||||||
"with_primary_key": params.primary_key,
|
|
||||||
"index_creation": meilisearch.get_index(path.index_uid.clone()).await.is_ok(),
|
|
||||||
}),
|
|
||||||
Some(&req),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
document_addition(
|
document_addition(
|
||||||
|
Loading…
Reference in New Issue
Block a user