Skip to content

[Feedback]: Generated curl example for bulk is incorrect #5864

@gregoryjcoates

Description

@gregoryjcoates

The example generated for curl when using the drop down in the top right on the bulk page is incorrect. It generates it as a json array, while bulk only accepts ndjson, which is correctly stated in the documentation. The curl example farther down the page in the documentation is also correct.

curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '[{"index":{"_index":"test","_id":"1"}},{"field1":"value1"},{"delete":{"_index":"test","_id":"2"}},{"create":{"_index":"test","_id":"3"}},{"field1":"value3"},{"update":{"_id":"1","_index":"test"}},{"doc":{"field2":"value2"}}]' "$ELASTICSEARCH_URL/_bulk"

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions