We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
BulkCreate
id
create
_id
Look at https://github.com/opensearch-project/opensearch-rs/blob/main/opensearch/src/root/bulk.rs#L228 where the new method requires the id.
new
new should have a variant pub fn new<S>(source: B) -> Self (or some other name as we cannot overload in Rust)
pub fn new<S>(source: B) -> Self
any
N/A
no
The text was updated successfully, but these errors were encountered:
Thanks for the report @sharp-pixel, would you be interested in making a PR to add this optional constructor?
Sorry, something went wrong.
What are your thoughts on adjusting the existing API for consistency with how "optional" _id fields are handled?
This would be a breaking change, but could potentially make the API more intuitive/consistent if id was handled consistently per the API.
Instead of making a new constructor, what do you think about having a consistent handling of optional API fields?
new(source: B)
id(id: S)
new(id: Option<S>, source: B)
BulkCreateOperation::new(id, source)
opensearch-rs/opensearch/src/root/bulk.rs
Line 179 in 41417d4
BulkUpdateOperation::new(id, source)
Line 200 in 41417d4
BulkIndexOperation::new(source)
id()
Line 184 in 41417d4
No branches or pull requests
What is the bug?
BulkCreate
operation requires anid
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 acreate
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 theid
.What is the expected behavior?
new
should have a variantpub 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
The text was updated successfully, but these errors were encountered: