0

我正在尝试将 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)

此代码总是超时。我也尝试过不同的超时值。我在这里错过了什么吗?

4

0 回答 0