• 请不要在回答技术问题时复制粘贴 AI 生成的内容
Red998
V2EX  ›  程序员

大佬们:请教一个 es 批量更新数据问题

  •  
  •   Red998 · Aug 2, 2022 · 2151 views
    This topic created in 1409 days ago, the information mentioned may be changed or developed.
    es API update-by-query 默认最大是 10000 条.大于 1w 条就报错、大佬们有啥好的办法?
    5 replies    2022-08-03 20:57:36 +08:00
    wbd31
        1
    wbd31  
       Aug 3, 2022
    报啥错,update by query 内部不是使用 scroll 来查询的吗
    Red998
        2
    Red998  
    OP
       Aug 3, 2022
    @wbd31 最大也只是 1w 条
    zzl22100048
        3
    zzl22100048  
       Aug 3, 2022
    update-by-query 会更新所有命中,size 是每批修改的数量
    cowcomic
        4
    cowcomic  
       Aug 3, 2022
    从官方文档上看,update-by-query 就会更新所有命中的数据,只不过可以通过 scroll_size 来设置滚动大小
    通过 max_docs 参数来设计最多改多少数据,如果不设置就是默认全部数据
    Red998
        5
    Red998  
    OP
       Aug 3, 2022
    @cowcomic 嗯 我看了 API 源码 确实这样
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   961 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 20:09 · PVG 04:09 · LAX 13:09 · JFK 16:09
    ♥ Do have faith in what you're doing.