我是Python和Elasticsearch的新手。 我正在尝试编写代码,用bulk在elasticsearch中插入文档。基于以下描述: http://pyelasticsearch.readthedocs.io/en/latest/api/#pyelasticsearch.ElasticSearch.bulk
我的代码:
>>> from pyelasticsearch import ElasticSearch
>>> es = ElasticSearch()
>>> es.bulk([es.index_op(doc={'id': 1, 'color': 'red'}), es.index_op(doc={'id': 2, 'color': 'green'})], doc_type='test10', index='test10')
Python返回以下错误消息:
^{pr2}$但它会将这些文档插入到Elasticsearch中。在
我的用途:
Linux Mint 18.1
Elasticsearch 5.5.0 (engine)
virtualenv
Python 3.5.2
pyelasticsearch 1.4
elasticsearch 5.4.0 (package in virtual env "test_env")
请告诉我我哪里错了,如何改正错误。谢谢!在
目前没有回答
相关问题 更多 >
编程相关推荐