Skip to content

[BUG] BulkCreate operation should support optional _id #241

@sharp-pixel

Description

@sharp-pixel

What is the bug?

BulkCreate operation requires an id to be specified, when it is optional in the original documentation: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docs-bulk.html#bulk-api-request-body. Note that Data Streams require the use of a create operation and the _id should be auto-generated by OpenSearch as a best practice for log analytics.

How can one reproduce the bug?

Look at https://github.com/opensearch-project/opensearch-rs/blob/main/opensearch/src/root/bulk.rs#L228 where the new method requires the id.

What is the expected behavior?

new should have a variant pub fn new<S>(source: B) -> Self (or some other name as we cannot overload in Rust)

What is your host/environment?

any

Do you have any screenshots?

N/A

Do you have any additional context?

no

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions