我有一个小(~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 错误]