如何通过Solr Admin Documents页面添加多个JSON文档?

我尝试了json:

[
{
   "id" : "001",
   "name" : "Ram",
   "age" : 53,
   "Designation" : "Manager",
   "Location" : "Hyderabad",
},
{
   "id" : "002",
   "name" : "Robert",
   "age" : 43,
   "Designation" : "SR.Programmer",
   "Location" : "Chennai",
},
{
   "id" : "003",
   "name" : "Rahim",
   "age" : 25,
   "Designation" : "JR.Programmer",
   "Location" : "Delhi",
}
]


单击提交文档后,它返回错误:


  状态:错误
  错误:错误的请求
   “ msg”:“预期:OBJECT_START,但ARRAY_START为[16]”,
      “代码”:400

最佳答案

卸下[]括号,这对我有用。

{
      "id" : "001",
      "name" : "Ram",
      "age" : 53,
      "Designation" : "Manager",
      "Location" : "Hyderabad"
   },
   {
      "id" : "002",
      "name" : "Robert",
      "age" : 43,
      "Designation" : "SR.Programmer",
      "Location" : "Chennai"
   },
   {
      "id" : "003",
      "name" : "Rahim",
      "age" : 25,
      "Designation" : "JR.Programmer",
      "Location" : "Delhi"
   }

10-06 13:03