我正在尝试将43Mb的文档添加到Elasticsearch中的索引中。我在python中使用批量API。以下是我的代码片段:
from elasticsearch import helpers
from elasticsearch import Elasticsearch
document = <read a 43Mb json file, with two fields>
action = [
{
"_index":"test_index",
"_type":"test_type",
"_id": 1
}
]
action[0]["_source"]=document
es = Elasticsearch(hosts=<HOST>:9200, timeout = 30)
helpers.bulk(es, action)
此代码总是超时。我也试过不同的超时值。我在这里错过了什么吗?