V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
choulinlin
V2EX  ›  Elasticsearch

聚合搜索 设置 size:0 无效 elasticsearch 6.1.2

  •  
  •   choulinlin · 2018-02-08 11:34:09 +08:00 · 3250 次点击
    这是一个创建于 2240 天前的主题,其中的信息可能已经有所发展或是发生改变。

    curl -XPOST { "size" : 0, "aggs": { "group_by_state": { "terms": { "field": "brand_id" } } } } 结果还是只返回 10 行数据 ,sum_other_doc_count 不为 0

    oaix
        1
    oaix  
       2018-02-08 22:07:59 +08:00
    最外层的 size 是限制 hits 的,如果要设置 terms 聚合的桶数量, 要在 field 那一层设置 size
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1062 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 22:43 · PVG 06:43 · LAX 15:43 · JFK 18:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.