poorX

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  117 随笔 :: 0 文章 :: 11 评论 :: 16万 阅读
高版本问题

The client noticed that the server is not a supported distribution of Elasticsearch

尽量使用 elasticsearch==7.13.4

https://blog.csdn.net/songkai558919/article/details/119568829

https://blog.csdn.net/alex_xfboy/article/details/86100037

参考:https://elasticsearch-py.readthedocs.io/en/master/helpers.html#elasticsearch.helpers.bulk

def gendata():
    mywords = ['foo', 'bar', 'baz']
    for word in mywords:
        yield {
            "_index": "mywords",
            "_type": "document",
            "doc": {"word": word},
        }

res_tuple = helpers.bulk(es, gendata())
res_tuple

Helper for the bulk() api that provides a more human friendly interface - it consumes an iterator of actions and sends them to elasticsearch in chunks. It returns a tuple with summary information - number of successfully executed actions and either list of errors or number of errors if stats_only is set to True. Note that by default we raise a BulkIndexError when we encounter an error so options like stats_only only apply when raise_on_error is set to False.

posted on   poorX  阅读(98)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
历史上的今天:
2019-04-23 【perl】simpleHTTP
点击右上角即可分享
微信分享提示