【发布时间】:2015-12-24 20:02:51
【问题描述】:
我开始使用弹性搜索,我正在尝试使用 _bulk 方法加载 JSON 数据集。但我收到以下错误。
{
"error" : {
"root_cause" : [ {
"type" : "illegal_argument_exception",
"reason" : "Malformed action/metadata line [1], expected START_OBJECT or END_OBJECT but found [VALUE_NUMBER]"
} ],
"type" : "illegal_argument_exception",
"reason" : "Malformed action/metadata line [1], expected START_OBJECT or END_OBJECT but found [VALUE_NUMBER]"
},
"status" : 400
}
我的 JSON 文件似乎有些问题,我验证了 JSON,似乎没问题。
这是我的示例文件。
{
"id": 3,
"customer_number": "",
"last_name": "anon",
"first_name": "zin",
"email": "anon@xyz.com",
"phone_number": "409-860-9006 x109",
"registered_at": "2007-05-02T16:27:50.74-05:00",
"last_visit_at": "2014-07-18T11:06:15-05:00",
"adcode": "",
"adcode_id": 0,
"affiliate_id": null,
"customer_type_id": 0,
"is_no_tax_customer": true,
"comments": "a",
"store_id": 5,
"source": "",
"search_string": "",
"no_account": false,
"sales_person": "SSB",
"alternate_phone_number": "800-936-9006 x109",
"is_affiliate_customer": false,
"updated_at": "2014-06-30T18:34:11.043-05:00",
"created_at": "2007-05-02T16:27:50.74-05:00",
"username": "",
"is_contact_information_only": false,
"tax_exemption_number": "",
"company": "anon",
"source_group": "",
"store_payment_methods_enabled": [0],
}
下面会提到用于发布数据的语句。
curl -XPOST 'localhost:9200/customer/_bulk?pretty' --data-binary "@account_sample.json"
谁能帮我解决这个问题?
【问题讨论】:
标签: elasticsearch load bulkinsert