Subrato1
(Subrato Pal)
August 8, 2023, 7:32am
1
PUT /library/_bulk?refresh
{"index":{"_id": "Leviathan Wakes"}}
{"name": "Leviathan Wakes", "author": "James S.A. Corey", "release_date": "2011-06-02", "page_count": 561}
{"index":{"_id": "Hyperion"}}
{"name": "Hyperion", "author": "Dan Simmons", "release_date": "1989-05-26", "page_count": 482}
{"index":{"_id": "Dune"}}
{"name": "Dune", "author": "Frank Herbert", "release_date": "1965-06-01", "page_count": 604}
I am getting one error :
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Malformed action/metadata line [1], expected START_OBJECT but found [START_ARRAY]"
}
],
"type": "illegal_argument_exception",
"reason": "Malformed action/metadata line [1], expected START_OBJECT but found [START_ARRAY]"
},
"status": 400
}
dadoonet
(David Pilato)
August 8, 2023, 8:18am
2
Could you try the same thing in Kibana?
It looks good to me.
Is it EXACTLY what you are sending?
Subrato1
(Subrato Pal)
August 8, 2023, 10:19am
3
Yes, Its working properly in Dev Tool but in our scope, we want to execute it in Postman.
dadoonet
(David Pilato)
August 8, 2023, 2:33pm
4
You need to make sure that Postman converts the request to something like:
$ cat requests
{ "index" : { "_index" : "test", "_id" : "1" } }
{ "field1" : "value1" }
$ curl -s -H "Content-Type: application/x-ndjson" -XPOST localhost:9200/_bulk --data-binary "@requests"; echo
{"took":7, "errors": false, "items":[{"index":{"_index":"test","_id":"1","_version":1,"result":"created","forced_refresh":false}}]}
See the application/x-ndjson
part...
system
(system)
Closed
September 5, 2023, 2:33pm
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.