# Trying to use Aggregate, "Fielddata is disabled on text fields by default. Set fielddata=true"

**URL:** <https://discuss.elastic.co/t/trying-to-use-aggregate-fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true/173259>\
**Category:** Elasticsearch\
**Created:** [March 21, 2019, 7:49am UTC](https://discuss.elastic.co/t/trying-to-use-aggregate-fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true/173259 "2019-03-21T07:49:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Noctis17](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/noctis17/32/41656_2.png) [@Noctis17](https://discuss.elastic.co/u/Noctis17)\
**Post date:** [March 21, 2019, 9:20am UTC](https://discuss.elastic.co/t/trying-to-use-aggregate-fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true/173259/3 "2019-03-21T09:20:22Z")

</div>

hello sir @dadoonet, thank you for the fast response!

may I know how to run my aggregation on **author\_id.keyword**? is it supposed to look like this?

```
'aggs' => [
				'authors' => [
					'terms' => [
						'field' => 'author_id.keyword',
						'size' => 25,
						'order' => ['_term' => 'asc']
					]
				],
			]

```

If it is correct, I've started retrieving buckets!

Again, thank you very much, appreciate it! 😃

---

_[View the full topic](https://discuss.elastic.co/t/trying-to-use-aggregate-fielddata-is-disabled-on-text-fields-by-default-set-fielddata-true/173259)._
