在分析弹性搜索响应时,即使文档数为零,我也看到了存储桶的出现。弹性搜索中是否有任何配置来限制没有任何相关文档的存储桶? 下面是我的弹性搜索聚合响应。
{"depthAgg":{"buckets":[{"key":"*-10.0","to":10.0,"doc_count":0},{"key":"10.0-20.0","from":10.0,"to":20.0,"doc_count":0},{"key":"20.0-30.0","from":20.0,"to":30.0,"doc_count":0},{"key":"30.0-40.0","from":30.0,"to":40.0,"doc_count":0},{"key":"40.0-50.0","from":40.0,"to":50.0,"doc_count":1},{"key":"50.0-60.0","from":50.0,"to":60.0,"doc_count":1},{"key":"60.0-70.0","from":60.0,"to":70.0,"doc_count":0},{"key":"70.0-80.0","from":70.0,"to":80.0,"doc_count":0},{"key":"80.0-90.0","from":80.0,"to":90.0,"doc_count":0},{"key":"90.0-100.0","from":90.0,"to":100.0,"doc_count":0},{"key":"100.0-200.0","from":100.0,"to":200.0,"doc_count":0},{"key":"200.0-300.0","from":200.0,"to":300.0,"doc_count":0},{"key":"300.0-400.0","from":300.0,"to":400.0,"doc_count":0},{"key":"400.0-500.0","from":400.0,"to":500.0,"doc_count":0},{"key":"500.0-600.0","from":500.0,"to":600.0,"doc_count":0},{"key":"600.0-700.0","from":600.0,"to":700.0,"doc_count":0},{"key":"700.0-800.0","from":700.0,"to":800.0,"doc_count":0},{"key":"800.0-900.0","from":800.0,"to":900.0,"doc_count":0},{"key":"900.0-1000.0","from":900.0,"to":1000.0,"doc_count":0},{"key":"1000.0-*","from":1000.0,"doc_count":0}]}
答案 0 :(得分:0)
对于术语和直方图聚合,您可以将"min_doc_count": 1
设置为仅返回包含至少一个文档的存储桶。