问题描述
我正在Postman发布以下内容:
URL POST
或 PUT
至 http: // localhost:9200 / _bulk
请求正文:
{update:{_index:test_people,_type:person,_id:1}} \\\
{doc:{name:年龄:100}} \\\
我已尝试过,没有 \\\
。我总是得到
{
error:ActionRequestValidationException [验证失败:1:不添加任何请求] ,
状态:500
}
它也做同样的事情使用数据创建:
{
创建:{
_index: test_people,
_type:person,
_id:1
}
}
{
name
年龄:100
}
更新
我已经在Mac,PC和Linux上尝试过,我不断得到相同的错误。
即使我在最后一行有 \\\
,我真的HAD在我的最后一个json行之后有一个完整的回车。
以下工作:
{update:{_index: test_people,_type:person,_id:1}} \\\
{doc:{name:年龄:100}}
所以在doc
行之下需要一个空行。
Trying to get Bulk Update to work on ES 1.0.1.
I am within Postman posting the following:
URL POST
or PUT
to http://localhost:9200/_bulk
Request Body:
{ "update" : { "_index" : "test_people", "_type" : "person", "_id" : "1" }} \n
{ "doc" : { "name":"hi", "age":100 }} \n
I have tried it with and without the \n
. 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
}
Update
I have tried this on a Mac, PC, and Linux and I am continually getting the same error.
Even though i had \n
on the last line I literally HAD to have a full carriage return after my last json line.
The following worked:
{ "update" : { "_index" : "test_people", "_type" : "person", "_id" : "1" }} \n
{ "doc" : { "name":"hi", "age":100 }}
So there needs to be an empty line below the "doc"
line.
这篇关于弹性搜索“未添加请求”批量API错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!