{
  "id": "elasticsearch/aggregation-max-size-exceeded",
  "signature": "ElasticsearchException: The aggregation [my_agg] exceeded the max size of [10000]",
  "signature_zh": "ElasticsearchException：聚合[my_agg]超过了最大大小[10000]",
  "regex": "exceeded the max size of \\[10000\\]",
  "domain": "elasticsearch",
  "category": "query_error",
  "subcategory": null,
  "root_cause": "A terms aggregation request has a size parameter larger than the default max size limit of 10000.",
  "root_cause_type": "generic",
  "root_cause_zh": "terms聚合请求的size参数超过了默认的最大大小限制10000。",
  "versions": [
    {
      "version": "elasticsearch 7.15.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "elasticsearch 8.8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "elasticsearch 8.13.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Size 0 is treated as unlimited, but can cause memory overflow and is deprecated in newer versions.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The cluster-level max size limit still applies; the error persists unless the limit is raised.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Composite aggregation has its own limits and may not be suitable for all use cases.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase the max size limit dynamically: PUT _cluster/settings { \"transient\": { \"search.max_buckets\": 20000 } }",
      "success_rate": 0.85,
      "how": "Increase the max size limit dynamically: PUT _cluster/settings { \"transient\": { \"search.max_buckets\": 20000 } }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reduce the aggregation size to 10000 or lower, and use pagination with composite aggregation for larger datasets.",
      "success_rate": 0.9,
      "how": "Reduce the aggregation size to 10000 or lower, and use pagination with composite aggregation for larger datasets.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a filtered aggregation to narrow down the result set, e.g., add a query filter before the aggregation.",
      "success_rate": 0.75,
      "how": "Use a filtered aggregation to narrow down the result set, e.g., add a query filter before the aggregation.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "动态增加最大大小限制：PUT _cluster/settings { \"transient\": { \"search.max_buckets\": 20000 } }",
    "将聚合size减少到10000或更少，并对更大数据集使用composite聚合进行分页。",
    "使用过滤聚合缩小结果集，例如在聚合前添加查询过滤器。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}