async fn update_documents(
    data: GuardedData<Private, Data>,
    path: web::Path<IndexParam>,
    params: web::Query<UpdateDocumentsQuery>,
    body: Payload,
) -> Result<HttpResponse, ResponseError> {
    debug!("called with params: {:?}", params);
    let update = data
        .add_documents(
            path.into_inner().index_uid,
            IndexDocumentsMethod::UpdateDocuments,
            UpdateFormat::Json,
            body,
            params.primary_key.clone(),
        )
        .await?;

    debug!("returns: {:?}", update);
    Ok(HttpResponse::Accepted().json(serde_json::json!({ "updateId": update.id() })))
}
/// Route used when the payload type is "application/json"
/// Used to add or replace documents
Route used when the payload type is "application/json"
Used to add or replace documents
Route used when the payload type is " application / json " Used to add or replace documents
async fn update_documents(
    data: GuardedData<Private, Data>,
    path: web::Path<IndexParam>,
    params: web::Query<UpdateDocumentsQuery>,
    body: Payload,
) -> Result<HttpResponse, ResponseError> {
    debug!("called with params: {:?}", params);
    let update = data
        .add_documents(
            path.into_inner().index_uid,
            IndexDocumentsMethod::UpdateDocuments,
            UpdateFormat::Json,
            body,
            params.primary_key.clone(),
        )
        .await?;
    debug!("returns: {:?}", update);
    Ok(HttpResponse::Accepted().json(serde_json::json!({ "updateId": update.id() })))
}
async fn update_documents ( data : GuardedData < Private , Data > , path : web :: Path < IndexParam > , params : web :: Query < UpdateDocumentsQuery > , body : Payload , ) -> Result < HttpResponse , ResponseError > { debug ! ( " " params ) ; let update = data . add_documents ( path . into_inner ( ) . index_uid , IndexDocumentsMethod :: UpdateDocuments , UpdateFormat :: Json , body , params . primary_key . clone ( ) , ) . await ? ; debug ! ( " " update ) ; Ok ( HttpResponse :: Accepted ( ) . json ( serde_json :: json ! ( { " " update id ( ) } ) ) ) }
Route used when the payload type is "application/json"
Used to add or replace documents
Route used when the payload type is " application / json " Used to add or replace documents
data
GuardedData<Private, Data>
path
web::Path<IndexParam>
params
web::Query<UpdateDocumentsQuery>
body
Payload
data
GuardedData<Private, Data>
path
web::Path<IndexParam>
params
web::Query<UpdateDocumentsQuery>
body
Payload