【发布时间】:2012-12-09 10:02:28
【问题描述】:
我有一个小的 (~50,00) json 字典数组,我想在 ES 中存储/索引。我的偏好是使用 python,因为我要索引的数据来自 csv 文件,通过 python 加载并转换为 json。或者,我想跳过转换为 json 的步骤,而只需使用我拥有的 python 字典数组。无论如何,快速搜索揭示了 ES 的批量索引功能。我想做这样的事情:
post_url = 'http://localhost:9202/_bulk'
request.post(post_url, data = acc ) # acc a python array of dictionaries
或
post_url = 'http://localhost:9202/_bulk'
request.post(post_url, params = acc ) # acc a python array of dictionaries
两个请求都给出 [HTTP 500 错误]
【问题讨论】:
标签: indexing elasticsearch python-requests