问题描述:

I created the following map like so

curl -XPUT http://localhost:9200/movies -d '

{

"mappings" : {

"_default_" : {

"properties" : {

"title" : {"type": "string", "index" : "not_analyzed" },

"director" : {"type": "string", "index" : "not_analyzed" },

"year" : { "type" : "integer" }

}

}

}

}

';

I have file called others2.json with the contents

{"index":{"_index":"movies","_type":"movie","_id":1}}

{"title": "Movie1","director": "director1","year": 1962}

with an extra line in the end.

When I try to added the contents of other2.json with the line curl -XPUT localhost:9200/_bulk --data-binary @other2.json I get the following error message

{"error":"ActionRequestValidationException[Validation Failed: 1: no requests added;]","status":500}

What am I doing wrong?

网友答案:

Added \n at the end of all lines. This fixed it.

相关阅读:
Top