Skip to content

bulk operation fail is not correctly parsed #148

@Stargateur

Description

@Stargateur

if one of a bulk operation fail, the return result will not contain field that are here only when succefull such as shards and _version, so this result in a jsonerror and so it's impossible to get the error.

Put their field as Option work but there is no error field, I add it in a fork and try this:

#[derive(Debug, serde::Deserialize)]
pub struct BulkError {
    #[serde(rename = "type")]
    pub kind: String,
    pub reason: String,
    pub index_uuid: String,
    pub shard: String,
    pub index: String,
}

following https://www.elastic.co/guide/en/elasticsearch/reference/7.7/docs-bulk.html#bulk-api-response-body but it's reported that index_uuid was missing, my elastic search is 7.3 so I look https://www.elastic.co/guide/en/elasticsearch/reference/7.3/docs-bulk.html#bulk-api-response-body but response body is not documented, this mean elastic introduce some breaking change in minor version as well, at this point I try to stay calm, anyway, I will try soon:

#[derive(Debug, serde::Deserialize)]
pub struct BulkError {
    #[serde(rename = "type")]
    pub kind: String,
    pub reason: String,
    pub index_uuid: Option<String>,
    pub shard: String,
    pub index: String,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions