Elasticsearch“没有添加请求"批量 API 错误 [英] Elasticsearch "no requests added" Bulk API Error
问题描述
尝试让批量更新在 ES 1.0.1 上运行.
Trying to get Bulk Update to work on ES 1.0.1.
我在 Postman 发布以下内容:
I am within Postman posting the following:
URL POST
或 PUT
到 http://localhost:9200/_bulk
请求正文:
{ "update" : { "_index" : "test_people", "_type" : "person", "_id" : "1" }}
{ "doc" : { "name":"hi", "age":100 }}
我已经尝试过使用和不使用
.我总是得到
I have tried it with and without the
. I always get
{
"error": "ActionRequestValidationException[Validation Failed: 1: no requests added;]",
"status": 500
}
它也在使用数据创建时做同样的事情:
It also does the same thing on a create using the data:
{
"create": {
"_index": "test_people",
"_type": "person",
"_id": "1"
}
}
{
"name": "hi",
"age": 100
}
更新
我已经在 Mac、PC 和 Linux 上尝试过这个,但我不断遇到同样的错误.
Update
I have tried this on a Mac, PC, and Linux and I am continually getting the same error.
推荐答案
即使我在最后一行有
我确实必须在我的最后一行 json 之后有一个完整的回车.
Even though i had
on the last line I literally HAD to have a full carriage return after my last json line.
以下有效:
{ "update" : { "_index" : "test_people", "_type" : "person", "_id" : "1" }}
{ "doc" : { "name":"hi", "age":100 }}
所以需要在 "doc"
行下面有一个空行.
So there needs to be an empty line below the "doc"
line.
这篇关于Elasticsearch“没有添加请求"批量 API 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!