# \_field\_names too large with CircuitBreakingException

**URL:** <https://discuss.elastic.co/t/-field-names-too-large-with-circuitbreakingexception/49352>\
**Category:** Elasticsearch\
**Created:** [May 5, 2016, 10:21pm UTC](https://discuss.elastic.co/t/-field-names-too-large-with-circuitbreakingexception/49352 "2016-05-05T22:21:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruben\_van\_Vreeland](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruben_van_vreeland/32/8443_2.png) [@Ruben\_van\_Vreeland](https://discuss.elastic.co/u/Ruben_van_Vreeland)\
**Post date:** [May 5, 2016, 10:21pm UTC](https://discuss.elastic.co/t/-field-names-too-large-with-circuitbreakingexception/49352/1 "2016-05-05T22:21:53Z")

</div>

Querying the full \_field\_names or using \_field\_names in an aggregation, leads to a CircuitBreakingException. According to the \_mapping API, the index holds about 10,000 different field names. Since the \_field\_names is autogenerated and is probably indexed, doc\_values cannot be used.

As a workaround I use the mapping API on the full index, but what is the suggested workaround to get field names over aggregations?

Query:

```
{
  "size" : 0,
  "aggregations" : {
    "fields" : {
      "terms" : {
        "field" : "_field_names",
        "size" : 1000,
        "order" : {
          "_count" : "desc"
        },
        "include" : "c.*"
      }
    }
  }
}

```

Exception

```
{
	"took": 138,
	"timed_out": false,
	"_shards": {
		"total": 11,
		"successful": 6,
		"failed": 5,
		"failures": [{
			"shard": 0,
			"index": "bits",
			"node": "L_u3ef-pRwCV5BWBXulq_Q",
			"reason": {
				"type": "exception",
				"reason": "ElasticsearchException[CircuitBreakingException[[fielddata] Data too large, data for [_field_names] would be larger than limit of [623326003/594.4mb]]]; nested: UncheckedExecutionException[CircuitBreakingException[[fielddata] Data too large, data for [_field_names] would be larger than limit of [623326003/594.4mb]]]; nested: CircuitBreakingException[[fielddata] Data too large, data for [_field_names] would be larger than limit of [623326003/594.4mb]];",
				"caused_by": {
					"type": "unchecked_execution_exception",
					"reason": "ElasticsearchException[CircuitBreakingException[[fielddata] Data too large, data for [_field_names] would be larger than limit of [623326003/594.4mb]]]; nested: UncheckedExecutionException[CircuitBreakingException[[fielddata] Data too large, data for [_field_names] would be larger than limit of [623326003/594.4mb]]]; nested: CircuitBreakingException[[fielddata] Data too large, data for [_field_names] would be larger than limit of [623326003/594.4mb]];",
					"caused_by": {
						"type": "exception",
						"reason": "CircuitBreakingException[[fielddata] Data too large, data for [_field_names] would be larger than limit of [623326003/594.4mb]]",
						"caused_by": {
							"type": "unchecked_execution_exception",
							"reason": "CircuitBreakingException[[fielddata] Data too large, data for [_field_names] would be larger than limit of [623326003/594.4mb]]",
							"caused_by": {
								"type": "circuit_breaking_exception",
								"reason": "[fielddata] Data too large, data for [_field_names] would be larger than limit of [623326003/594.4mb]",
								"bytes_wanted": 985496399,
								"bytes_limit": 623326003
							}
						}
					}
				}
			}
		}]
	},
	"hits": {
		"total": 63,
		"max_score": 0.0,
		"hits": []
	},
	"aggregations": {
		"fields": {
			"doc_count_error_upper_bound": 0,
			"sum_other_doc_count": 0,
			"buckets": []
		}
	}
}
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:53pm UTC](https://discuss.elastic.co/t/-field-names-too-large-with-circuitbreakingexception/49352/2 "2017-07-05T22:53:34Z")

</div>


