【问题标题】:Elasticsearch Validation FailedElasticsearch 验证失败
【发布时间】:2014-11-18 00:45:23
【问题描述】:

我像这样创建了以下地图

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" }
   }
  }
 }
}
';

我有一个名为 others2.json 的文件

{"index":{"_index":"movies","_type":"movie","_id":1}}
{"title": "Movie1","director": "director1","year": 1962}

最后多了一行。

当我尝试使用 curl -XPUT localhost:9200/_bulk --data-binary @other2.json 行添加 other2.json 的内容时,我收到以下错误消息

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

我做错了什么?

【问题讨论】:

    标签: json elasticsearch


    【解决方案1】:

    在所有行的末尾添加了\n。这解决了它。

    【讨论】:

      猜你喜欢
      • 2021-12-15
      • 1970-01-01
      • 2012-03-15
      • 1970-01-01
      • 2012-10-18
      • 2017-09-21
      • 2015-09-11
      • 2021-07-27
      相关资源
      最近更新 更多