在学习es的过程中需要使用批量接口/_bulk批量插入数据,我是用的是postman的方式。
参数:
但是一直报错:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "The bulk request must be terminated by a newline [\\n]"
}
],
"type": "illegal_argument_exception",
"reason": "The bulk request must be terminated by a newline [\\n]"
},
"status": 400
}
从报错上看是 没有/_bulk要求的换行\n。书中说每一行都需要有一个换行\n,使用postman的时候接口报错。最后发现是最后需要一个空行。
只能说学到了。