# Aggregation on a scripted field

**URL:** <https://discuss.elastic.co/t/aggregation-on-a-scripted-field/193286>\
**Category:** Elasticsearch\
**Created:** [August 1, 2019, 9:34am UTC](https://discuss.elastic.co/t/aggregation-on-a-scripted-field/193286 "2019-08-01T09:34:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HansPeterSloot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hanspetersloot/32/51132_2.png) [@HansPeterSloot](https://discuss.elastic.co/u/HansPeterSloot)\
**Post date:** [August 1, 2019, 9:34am UTC](https://discuss.elastic.co/t/aggregation-on-a-scripted-field/193286/1 "2019-08-01T09:34:12Z")

</div>

Hello all,

I have created a scripted field to an index.  
As far as I can see it is aggregatable.  
See below:

GET master\*/\_field\_caps?fields=Size  
{  
"fields" : {  
"Size" : {  
"text" : {  
"type" : "text",  
"searchable" : true,  
"aggregatable" : true  
}  
}  
}  
}

But queries with aggregations return no results.

Am I missing something?

Regards Hans

---

<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:** [August 29, 2019, 9:34am UTC](https://discuss.elastic.co/t/aggregation-on-a-scripted-field/193286/2 "2019-08-29T09:34:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
